File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,13 +25,16 @@ public function createClient($url = null)
2525
2626 $ connector = new UnixConnector ($ this ->loop , $ url );
2727
28+ // create HttpClient for React 0.4/0.3 (code coverage will be achieved by testing both versions)
29+ // @codeCoverageIgnoreStart
2830 $ ref = new \ReflectionClass ('React\HttpClient\Client ' );
2931 if ($ ref ->getConstructor ()->getNumberOfRequiredParameters () == 2 ) {
3032 // react/http-client:0.4 removed the $loop parameter
3133 $ http = new HttpClient ($ connector , $ connector );
3234 } else {
3335 $ http = new HttpClient ($ this ->loop , $ connector , $ connector );
3436 }
37+ // @codeCoverageIgnoreEnd
3538
3639 $ sender = new Sender ($ http );
3740
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Clue \React \Docker \Factory ;
4+ use React \EventLoop \Factory as LoopFactory ;
5+
6+ class FactoryTest extends TestCase
7+ {
8+ private $ loop ;
9+ private $ factory ;
10+
11+ public function setUp ()
12+ {
13+ $ this ->loop = LoopFactory::create ();
14+ $ this ->factory = new Factory ($ this ->loop );
15+ }
16+
17+ public function testCreateClientDefault ()
18+ {
19+ $ client = $ this ->factory ->createClient ();
20+
21+ $ this ->assertInstanceOf ('Clue\React\Docker\Client ' , $ client );
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments