File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11language : php
22php :
3- - 5.3
3+ # - 5.3 # requires old distro, see below
4+ - 5.4
5+ - 5.5
46 - 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+
624install :
7- - composer install --prefer-source --no-interaction
25+ - composer install --no-interaction
26+
827script :
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
1212This is an alternative to DNS-Based Service Discovery (DNS-SD)
1313as defined in [ RFC 6763] ( http://tools.ietf.org/html/rfc6763 ) .
1414
15+ ** Table of Contents**
16+
17+ * [ Quickstart example] ( #quickstart-example )
18+ * [ Install] ( #install )
19+ * [ Tests] ( #tests )
20+ * [ License] ( #license )
21+
1522> Note: This project is in early alpha stage! Feel free to report any issues you encounter.
1623
1724## Quickstart example
@@ -53,6 +60,26 @@ The recommended way to install this library is [through composer](http://getcomp
5360}
5461```
5562
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+
5683## License
5784
5885MIT
Original file line number Diff line number Diff line change 1818 "react/event-loop" : " ~0.4.0|~0.3.0" ,
1919 "react/promise" : " ~2.0|~1.0" ,
2020 "clue/multicast-react" : " ~0.2.0"
21+ },
22+ "require-dev" : {
23+ "phpunit/phpunit" : " ^6.0 || ^5.7 || ^4.8.35"
2124 }
2225}
Original file line number Diff line number Diff line change 55
66class ClientTest extends TestCase
77{
8+ /**
9+ * @doesNotPerformAssertions
10+ */
811 public function testCtor ()
912 {
10- $ loop = $ this ->getMock ('React\EventLoop\LoopInterface ' );
13+ $ loop = $ this ->getMockBuilder ('React\EventLoop\LoopInterface ' )-> getMock ( );
1114 new Client ($ loop );
1215 }
1316
1417 public function testSearchCancel ()
1518 {
16- $ loop = $ this ->getMock ('React\EventLoop\LoopInterface ' );
19+ $ loop = $ this ->getMockBuilder ('React\EventLoop\LoopInterface ' )-> getMock ( );
1720 $ multicast = $ this ->getMockBuilder ('Clue\React\Multicast\Factory ' )->disableOriginalConstructor ()->getMock ();
1821 $ client = new Client ($ loop , $ multicast );
1922
20- $ socket = $ this ->getMock ('React\Datagram\SocketInterface ' );
23+ $ socket = $ this ->getMockBuilder ('React\Datagram\SocketInterface ' )-> getMock ( );
2124 $ socket ->expects ($ this ->once ())->method ('send ' );
2225
23- $ timer = $ this ->getMock ('React\EventLoop\Timer\TimerInterface ' );
26+ $ timer = $ this ->getMockBuilder ('React\EventLoop\Timer\TimerInterface ' )-> getMock ( );
2427 $ loop ->expects ($ this ->once ())->method ('addTimer ' )->will ($ this ->returnValue ($ timer ));
2528
2629 $ multicast ->expects ($ this ->once ())->method ('createSender ' )->will ($ this ->returnValue ($ socket ));
Original file line number Diff line number Diff line change 22
33require __DIR__ . '/../vendor/autoload.php ' ;
44
5- class TestCase extends PHPUnit_Framework_TestCase
5+ class TestCase extends PHPUnit \ Framework \TestCase
66{
77 protected function expectCallableOnce ()
88 {
@@ -19,24 +19,14 @@ protected function expectCallableNever()
1919 {
2020 $ mock = $ this ->createCallableMock ();
2121 $ mock
22- ->expects ($ this ->never ())
23- ->method ('__invoke ' );
22+ ->expects ($ this ->never ())
23+ ->method ('__invoke ' );
2424
2525 return $ mock ;
2626 }
2727
28- /**
29- * @link https://github.com/reactphp/react/blob/master/tests/React/Tests/Socket/TestCase.php (taken from reactphp/react)
30- */
3128 protected function createCallableMock ()
3229 {
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 ();
4131 }
4232}
You can’t perform that action at this time.
0 commit comments