File tree Expand file tree Collapse file tree 5 files changed +64
-22
lines changed Expand file tree Collapse file tree 5 files changed +64
-22
lines changed Original file line number Diff line number Diff line change 1
1
language : php
2
2
php :
3
- - 5.3
3
+ # - 5.3 # requires old distro, see below
4
+ - 5.4
5
+ - 5.5
4
6
- 5.6
5
- - hhvm
7
+ - 7.0
8
+ - 7.1
9
+ - 7.2
10
+ - hhvm # ignore errors, see below
11
+
12
+ # lock distro so future defaults will not break the build
13
+ dist : trusty
14
+
15
+ matrix :
16
+ include :
17
+ - php : 5.3
18
+ dist : precise
19
+ allow_failures :
20
+ - php : hhvm
21
+
22
+ sudo : false
23
+
6
24
install :
7
- - composer install --prefer-source --no-interaction
25
+ - composer install --no-interaction
26
+
8
27
script :
9
- - phpunit --coverage-text
28
+ - vendor/bin/ phpunit --coverage-text
Original file line number Diff line number Diff line change @@ -12,6 +12,13 @@ expired IETF draft: https://tools.ietf.org/html/draft-goland-http-udp-01
12
12
This is an alternative to DNS-Based Service Discovery (DNS-SD)
13
13
as defined in [ RFC 6763] ( http://tools.ietf.org/html/rfc6763 ) .
14
14
15
+ ** Table of Contents**
16
+
17
+ * [ Quickstart example] ( #quickstart-example )
18
+ * [ Install] ( #install )
19
+ * [ Tests] ( #tests )
20
+ * [ License] ( #license )
21
+
15
22
> Note: This project is in early alpha stage! Feel free to report any issues you encounter.
16
23
17
24
## Quickstart example
@@ -53,6 +60,26 @@ The recommended way to install this library is [through composer](http://getcomp
53
60
}
54
61
```
55
62
63
+ This project aims to run on any platform and thus does not require any PHP
64
+ extensions and supports running on legacy PHP 5.3 through current PHP 7+ and
65
+ HHVM.
66
+ It's * highly recommended to use PHP 7+* for this project.
67
+
68
+ ## Tests
69
+
70
+ To run the test suite, you first need to clone this repo and then install all
71
+ dependencies [ through Composer] ( https://getcomposer.org ) :
72
+
73
+ ``` bash
74
+ $ composer install
75
+ ```
76
+
77
+ To run the test suite, go to the project root and run:
78
+
79
+ ``` bash
80
+ $ php vendor/bin/phpunit
81
+ ```
82
+
56
83
## License
57
84
58
85
MIT
Original file line number Diff line number Diff line change 18
18
"react/event-loop" : " ~0.4.0|~0.3.0" ,
19
19
"react/promise" : " ~2.0|~1.0" ,
20
20
"clue/multicast-react" : " ~0.2.0"
21
+ },
22
+ "require-dev" : {
23
+ "phpunit/phpunit" : " ^6.0 || ^5.7 || ^4.8.35"
21
24
}
22
25
}
Original file line number Diff line number Diff line change 5
5
6
6
class ClientTest extends TestCase
7
7
{
8
+ /**
9
+ * @doesNotPerformAssertions
10
+ */
8
11
public function testCtor ()
9
12
{
10
- $ loop = $ this ->getMock ('React\EventLoop\LoopInterface ' );
13
+ $ loop = $ this ->getMockBuilder ('React\EventLoop\LoopInterface ' )-> getMock ( );
11
14
new Client ($ loop );
12
15
}
13
16
14
17
public function testSearchCancel ()
15
18
{
16
- $ loop = $ this ->getMock ('React\EventLoop\LoopInterface ' );
19
+ $ loop = $ this ->getMockBuilder ('React\EventLoop\LoopInterface ' )-> getMock ( );
17
20
$ multicast = $ this ->getMockBuilder ('Clue\React\Multicast\Factory ' )->disableOriginalConstructor ()->getMock ();
18
21
$ client = new Client ($ loop , $ multicast );
19
22
20
- $ socket = $ this ->getMock ('React\Datagram\SocketInterface ' );
23
+ $ socket = $ this ->getMockBuilder ('React\Datagram\SocketInterface ' )-> getMock ( );
21
24
$ socket ->expects ($ this ->once ())->method ('send ' );
22
25
23
- $ timer = $ this ->getMock ('React\EventLoop\Timer\TimerInterface ' );
26
+ $ timer = $ this ->getMockBuilder ('React\EventLoop\Timer\TimerInterface ' )-> getMock ( );
24
27
$ loop ->expects ($ this ->once ())->method ('addTimer ' )->will ($ this ->returnValue ($ timer ));
25
28
26
29
$ multicast ->expects ($ this ->once ())->method ('createSender ' )->will ($ this ->returnValue ($ socket ));
Original file line number Diff line number Diff line change 2
2
3
3
require __DIR__ . '/../vendor/autoload.php ' ;
4
4
5
- class TestCase extends PHPUnit_Framework_TestCase
5
+ class TestCase extends PHPUnit \ Framework \TestCase
6
6
{
7
7
protected function expectCallableOnce ()
8
8
{
@@ -19,24 +19,14 @@ protected function expectCallableNever()
19
19
{
20
20
$ mock = $ this ->createCallableMock ();
21
21
$ mock
22
- ->expects ($ this ->never ())
23
- ->method ('__invoke ' );
22
+ ->expects ($ this ->never ())
23
+ ->method ('__invoke ' );
24
24
25
25
return $ mock ;
26
26
}
27
27
28
- /**
29
- * @link https://github.com/reactphp/react/blob/master/tests/React/Tests/Socket/TestCase.php (taken from reactphp/react)
30
- */
31
28
protected function createCallableMock ()
32
29
{
33
- return $ this ->getMock ('CallableStub ' );
34
- }
35
- }
36
-
37
- class CallableStub
38
- {
39
- public function __invoke ()
40
- {
30
+ return $ this ->getMockBuilder ('stdClass ' )->setMethods (array ('__invoke ' ))->getMock ();
41
31
}
42
32
}
You can’t perform that action at this time.
0 commit comments