File tree Expand file tree Collapse file tree 5 files changed +21
-16
lines changed Expand file tree Collapse file tree 5 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ language: php
3
3
# lock distro so future defaults will not break the build
4
4
dist : trusty
5
5
6
- matrix :
6
+ jobs :
7
7
include :
8
8
- php : 5.3
9
9
dist : precise
@@ -17,7 +17,7 @@ matrix:
17
17
- php : 7.4
18
18
19
19
install :
20
- - composer install --no-interaction
20
+ - composer install
21
21
22
22
script :
23
23
- vendor/bin/phpunit --coverage-text
Original file line number Diff line number Diff line change 17
17
"require-dev" : {
18
18
"clue/hexdump" : " ~0.2.0" ,
19
19
"react/event-loop" : " ^1.0 || ^0.5 || ^0.4 || ^0.3" ,
20
- "phpunit/phpunit" : " ^7 .0 || ^6.0 || ^5.0 || ^4.8.35"
20
+ "phpunit/phpunit" : " ^9 .0 || ^5.7 || ^4.8.35"
21
21
},
22
22
"autoload" : {
23
23
"psr-4" : { "Clue\\ React\\ Tar\\ " : " src/" }
Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ class DecoderTest extends TestCase
10
10
{
11
11
private $ decoder ;
12
12
13
- public function setUp ()
13
+ /**
14
+ * @before
15
+ */
16
+ public function setUpDecoder ()
14
17
{
15
18
$ this ->decoder = new Decoder ();
16
19
}
Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ class FunctionDecoderTest extends TestCase
10
10
{
11
11
private $ decoder ;
12
12
13
- public function setUp ()
13
+ /**
14
+ * @before
15
+ */
16
+ public function setUpDecoderAndLoop ()
14
17
{
15
18
$ this ->decoder = new Decoder ();
16
19
$ this ->loop = Factory::create ();
Original file line number Diff line number Diff line change @@ -7,36 +7,35 @@ class TestCase extends \PHPUnit\Framework\TestCase
7
7
protected function expectCallableOnce ()
8
8
{
9
9
$ mock = $ this ->createCallableMock ();
10
- $ mock
11
- ->expects ($ this ->once ())
12
- ->method ('__invoke ' );
10
+ $ mock ->expects ($ this ->once ())->method ('__invoke ' );
13
11
14
12
return $ mock ;
15
13
}
16
14
17
15
protected function expectCallableOnceWith ($ value )
18
16
{
19
17
$ mock = $ this ->createCallableMock ();
20
- $ mock
21
- ->expects ($ this ->once ())
22
- ->method ('__invoke ' )
23
- ->with ($ value );
18
+ $ mock ->expects ($ this ->once ())->method ('__invoke ' )->with ($ value );
24
19
25
20
return $ mock ;
26
21
}
27
22
28
23
protected function expectCallableNever ()
29
24
{
30
25
$ mock = $ this ->createCallableMock ();
31
- $ mock
32
- ->expects ($ this ->never ())
33
- ->method ('__invoke ' );
26
+ $ mock ->expects ($ this ->never ())->method ('__invoke ' );
34
27
35
28
return $ mock ;
36
29
}
37
30
38
31
protected function createCallableMock ()
39
32
{
40
- return $ this ->getMockBuilder ('stdClass ' )->setMethods (array ('__invoke ' ))->getMock ();
33
+ if (method_exists ('PHPUnit\Framework\MockObject\MockBuilder ' , 'addMethods ' )) {
34
+ // PHPUnit 9+
35
+ return $ this ->getMockBuilder ('stdClass ' )->addMethods (array ('__invoke ' ))->getMock ();
36
+ } else {
37
+ // legacy PHPUnit 4 - PHPUnit 8
38
+ return $ this ->getMockBuilder ('stdClass ' )->setMethods (array ('__invoke ' ))->getMock ();
39
+ }
41
40
}
42
41
}
You can’t perform that action at this time.
0 commit comments