File tree Expand file tree Collapse file tree 13 files changed +89
-32
lines changed Expand file tree Collapse file tree 13 files changed +89
-32
lines changed Original file line number Diff line number Diff line change 11
11
strategy :
12
12
matrix :
13
13
php :
14
+ - 8.3
15
+ - 8.2
16
+ - 8.1
17
+ - 8.0
18
+ - 7.4
19
+ - 7.3
20
+ - 7.2
21
+ - 7.1
22
+ - 7.0
23
+ - 5.6
24
+ - 5.5
14
25
- 5.4
15
26
- 5.3
16
27
steps :
21
32
coverage : xdebug
22
33
- run : composer install
23
34
- run : vendor/bin/phpunit --coverage-text
35
+ if : ${{ matrix.php >= 7.3 }}
36
+ - run : vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
37
+ if : ${{ matrix.php < 7.3 }}
Original file line number Diff line number Diff line change 14
14
"php" : " >=5.3"
15
15
},
16
16
"require-dev" : {
17
- "phpunit/phpunit" : " ^4.8.36"
17
+ "phpunit/phpunit" : " ^9.6 || ^5.7 || ^ 4.8.36"
18
18
},
19
19
"autoload" : {
20
20
"psr-0" : {
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
3
- <!-- PHPUnit configuration file with old format for legacy PHPUnit -->
3
+ <!-- PHPUnit configuration file with new format for PHPUnit 9.6+ -->
4
4
<phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5
- xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/4.8 /phpunit.xsd"
5
+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.6 /phpunit.xsd"
6
6
bootstrap =" vendor/autoload.php"
7
- colors =" true" >
7
+ cacheResult =" false"
8
+ colors =" true"
9
+ convertDeprecationsToExceptions =" true" >
8
10
<testsuites >
9
11
<testsuite name =" Redis Protocol Test Suite" >
10
12
<directory >./tests/</directory >
11
13
</testsuite >
12
14
</testsuites >
13
- <filter >
14
- <whitelist >
15
+ <coverage >
16
+ <include >
15
17
<directory >./src/</directory >
16
- </whitelist >
17
- </filter >
18
+ </include >
19
+ </coverage >
18
20
<php >
19
21
<ini name =" error_reporting" value =" -1" />
20
22
</php >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+
3
+ <!-- PHPUnit configuration file with old format for legacy PHPUnit -->
4
+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5
+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/4.8/phpunit.xsd"
6
+ bootstrap =" vendor/autoload.php"
7
+ colors =" true" >
8
+ <testsuites >
9
+ <testsuite name =" Redis Protocol Test Suite" >
10
+ <directory >./tests/</directory >
11
+ </testsuite >
12
+ </testsuites >
13
+ <filter >
14
+ <whitelist >
15
+ <directory >./src/</directory >
16
+ </whitelist >
17
+ </filter >
18
+ <php >
19
+ <ini name =" error_reporting" value =" -1" />
20
+ </php >
21
+ </phpunit >
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ class FactoryTest extends TestCase
6
6
{
7
7
private $ factory ;
8
8
9
- public function setUp ()
9
+ /**
10
+ * @before
11
+ */
12
+ public function setUpFactory ()
10
13
{
11
14
$ this ->factory = new Factory ();
12
15
}
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ abstract class AbstractModelTest extends TestCase
8
8
9
9
abstract protected function createModel ($ value );
10
10
11
- public function setUp ()
11
+ /**
12
+ * @before
13
+ */
14
+ public function setUpSerializer ()
12
15
{
13
16
$ this ->serializer = new RecursiveSerializer ();
14
17
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ class ErrorReplyTest extends AbstractModelTest
6
6
{
7
7
protected function createModel ($ value )
8
8
{
9
- return new ErrorReply ($ value );
9
+ return new ErrorReply (( string ) $ value );
10
10
}
11
11
12
12
public function testError ()
Original file line number Diff line number Diff line change @@ -36,10 +36,10 @@ public function testNullMultiBulkReply()
36
36
/**
37
37
* @param MultiBulkReply $model
38
38
* @depends testNullMultiBulkReply
39
- * @expectedException UnexpectedValueException
40
39
*/
41
40
public function testNullMultiBulkReplyIsNotARequest (MultiBulkReply $ model )
42
41
{
42
+ $ this ->setExpectedException ('UnexpectedValueException ' );
43
43
$ model ->getRequestModel ();
44
44
}
45
45
@@ -91,10 +91,10 @@ public function testMixedReply()
91
91
/**
92
92
* @param MultiBulkReply $model
93
93
* @depends testMixedReply
94
- * @expectedException UnexpectedValueException
95
94
*/
96
95
public function testMixedReplyIsNotARequest (MultiBulkReply $ model )
97
96
{
97
+ $ this ->setExpectedException ('UnexpectedValueException ' );
98
98
$ model ->getRequestModel ();
99
99
}
100
100
Original file line number Diff line number Diff line change @@ -13,7 +13,10 @@ abstract class AbstractParserTest extends TestCase
13
13
14
14
abstract protected function createParser ();
15
15
16
- public function setUp ()
16
+ /**
17
+ * @before
18
+ */
19
+ public function setUpParser ()
17
20
{
18
21
$ this ->parser = $ this ->createParser ();
19
22
$ this ->assertInstanceOf ('Clue\Redis\Protocol\Parser\ParserInterface ' , $ this ->parser );
Original file line number Diff line number Diff line change @@ -110,23 +110,19 @@ public function testWhitespaceInlineIsIgnored()
110
110
$ this ->assertEquals (array (), $ this ->parser ->pushIncoming ($ message ));
111
111
}
112
112
113
- /**
114
- * @expectedException Clue\Redis\Protocol\Parser\ParserException
115
- */
116
113
public function testInvalidMultiBulkMustContainBulk ()
117
114
{
118
115
$ message = "*1 \r\n:123 \r\n" ;
119
116
117
+ $ this ->setExpectedException ('Clue\Redis\Protocol\Parser\ParserException ' );
120
118
$ this ->parser ->pushIncoming ($ message );
121
119
}
122
120
123
- /**
124
- * @expectedException Clue\Redis\Protocol\Parser\ParserException
125
- */
126
121
public function testInvalidBulkLength ()
127
122
{
128
123
$ message = "*1 \r\n$-1 \r\n" ;
129
124
125
+ $ this ->setExpectedException ('Clue\Redis\Protocol\Parser\ParserException ' );
130
126
$ this ->parser ->pushIncoming ($ message );
131
127
}
132
128
}
You can’t perform that action at this time.
0 commit comments