File tree Expand file tree Collapse file tree 5 files changed +87
-0
lines changed Expand file tree Collapse file tree 5 files changed +87
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Http \HttplugBundle \Tests \Unit \ClientFactory ;
4+
5+ use Http \HttplugBundle \ClientFactory \CurlFactory ;
6+ use Http \Client \Curl \Client ;
7+ use Http \Message \MessageFactory ;
8+ use Http \Message \StreamFactory ;
9+
10+ /**
11+ * @author Tobias Nyholm <tobias.nyholm@gmail.com>
12+ */
13+ class CurlFactoryTest extends \PHPUnit_Framework_TestCase
14+ {
15+ public function testCreateClient ()
16+ {
17+ $ factory = new CurlFactory ($ this ->getMock (MessageFactory::class), $ this ->getMock (StreamFactory::class));
18+ $ client = $ factory ->createClient ();
19+
20+ $ this ->assertInstanceOf (Client::class, $ client );
21+ }
22+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Http \HttplugBundle \Tests \Unit \ClientFactory ;
4+
5+ use Http \HttplugBundle \ClientFactory \Guzzle6Factory ;
6+ use Http \Adapter \Guzzle6 \Client ;
7+
8+ /**
9+ * @author Tobias Nyholm <tobias.nyholm@gmail.com>
10+ */
11+ class Guzzle6FactoryTest extends \PHPUnit_Framework_TestCase
12+ {
13+ public function testCreateClient ()
14+ {
15+ $ factory = new Guzzle6Factory ();
16+ $ client = $ factory ->createClient ();
17+
18+ $ this ->assertInstanceOf (Client::class, $ client );
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Http \HttplugBundle \Tests \Unit \ClientFactory ;
4+
5+ use Http \Adapter \React \Client ;
6+ use Http \HttplugBundle \ClientFactory \ReactFactory ;
7+ use Http \Message \MessageFactory ;
8+
9+ /**
10+ * @author Tobias Nyholm <tobias.nyholm@gmail.com>
11+ */
12+ class ReactFactoryTest extends \PHPUnit_Framework_TestCase
13+ {
14+ public function testCreateClient ()
15+ {
16+ $ factory = new ReactFactory ($ this ->getMock (MessageFactory::class));
17+ $ client = $ factory ->createClient ();
18+
19+ $ this ->assertInstanceOf (Client::class, $ client );
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Http \HttplugBundle \Tests \Unit \ClientFactory ;
4+
5+ use Http \Client \Socket \Client ;
6+ use Http \HttplugBundle \ClientFactory \SocketFactory ;
7+ use Http \Message \MessageFactory ;
8+
9+ /**
10+ * @author Tobias Nyholm <tobias.nyholm@gmail.com>
11+ */
12+ class SocketFactoryTest extends \PHPUnit_Framework_TestCase
13+ {
14+ public function testCreateClient ()
15+ {
16+ $ factory = new SocketFactory ($ this ->getMock (MessageFactory::class));
17+ $ client = $ factory ->createClient ();
18+
19+ $ this ->assertInstanceOf (Client::class, $ client );
20+ }
21+ }
Original file line number Diff line number Diff line change 2020 },
2121 "require-dev" : {
2222 "phpunit/phpunit" : " ^4.5" ,
23+ "php-http/curl-client" : " ^1.0" ,
24+ "php-http/socket-client" : " ^1.0" ,
2325 "php-http/guzzle6-adapter" : " ^1.0" ,
26+ "php-http/react-adapter" : " ^0.1" ,
2427 "php-http/message" : " ^1.0" ,
2528 "puli/composer-plugin" : " 1.0.0-beta9" ,
2629 "symfony/symfony" : " ^2.7|^3.0" ,
You can’t perform that action at this time.
0 commit comments