2
2
3
3
namespace React \Tests \MySQL \Io ;
4
4
5
- use PHPUnit \Framework \TestCase ;
6
5
use React \MySQL \Io \Buffer ;
6
+ use React \Tests \MySQL \BaseTestCase ;
7
7
8
- class BufferTest extends TestCase
8
+ class BufferTest extends BaseTestCase
9
9
{
10
10
public function testAppendAndReadBinary ()
11
11
{
@@ -16,15 +16,13 @@ public function testAppendAndReadBinary()
16
16
$ this ->assertSame ('hello ' , $ buffer ->read (5 ));
17
17
}
18
18
19
- /**
20
- * @expectedException LogicException
21
- */
22
19
public function testReadBeyondLimitThrows ()
23
20
{
24
21
$ buffer = new Buffer ();
25
22
26
23
$ buffer ->append ('hi ' );
27
24
25
+ $ this ->setExpectedException ('LogicException ' );
28
26
$ buffer ->read (3 );
29
27
}
30
28
@@ -38,27 +36,23 @@ public function testReadAfterSkipOne()
38
36
$ this ->assertSame ('i ' , $ buffer ->read (1 ));
39
37
}
40
38
41
- /**
42
- * @expectedException LogicException
43
- */
44
39
public function testSkipZeroThrows ()
45
40
{
46
41
$ buffer = new Buffer ();
47
42
48
43
$ buffer ->append ('hi ' );
49
44
45
+ $ this ->setExpectedException ('LogicException ' );
50
46
$ buffer ->skip (0 );
51
47
}
52
48
53
- /**
54
- * @expectedException LogicException
55
- */
56
49
public function testSkipBeyondLimitThrows ()
57
50
{
58
51
$ buffer = new Buffer ();
59
52
60
53
$ buffer ->append ('hi ' );
61
54
55
+ $ this ->setExpectedException ('LogicException ' );
62
56
$ buffer ->skip (3 );
63
57
}
64
58
@@ -203,14 +197,12 @@ public function testParseStringNullCharacterTwice()
203
197
$ this ->assertEquals ('world ' , $ buffer ->readStringNull ());
204
198
}
205
199
206
- /**
207
- * @expectedException LogicException
208
- */
209
200
public function testParseStringNullCharacterThrowsIfNullNotFound ()
210
201
{
211
202
$ buffer = new Buffer ();
212
203
$ buffer ->append ("hello " );
213
204
205
+ $ this ->setExpectedException ('LogicException ' );
214
206
$ buffer ->readStringNull ();
215
207
}
216
208
}
0 commit comments