22
33namespace Http \Client \Tests ;
44
5- use Http \Discovery \MessageFactoryDiscovery ;
65use Http \Message \MessageFactory ;
6+ use Http \Message \MessageFactory \GuzzleMessageFactory ;
77use Nerd \CartesianProduct \CartesianProduct ;
88use Psr \Http \Message \ResponseInterface ;
99
@@ -24,10 +24,10 @@ abstract class HttpBaseTest extends \PHPUnit_Framework_TestCase
2424 */
2525 protected $ defaultOptions = [
2626 'protocolVersion ' => '1.1 ' ,
27- 'statusCode ' => 200 ,
28- 'reasonPhrase ' => 'OK ' ,
29- 'headers ' => ['Content-Type ' => 'text/html ' ],
30- 'body ' => 'Ok ' ,
27+ 'statusCode ' => 200 ,
28+ 'reasonPhrase ' => 'OK ' ,
29+ 'headers ' => ['Content-Type ' => 'text/html ' ],
30+ 'body ' => 'Ok ' ,
3131 ];
3232
3333 /**
@@ -36,7 +36,7 @@ abstract class HttpBaseTest extends \PHPUnit_Framework_TestCase
3636 protected $ defaultHeaders = [
3737 'Connection ' => 'close ' ,
3838 'User-Agent ' => 'PHP HTTP Adapter ' ,
39- 'Content-Length ' => '0 '
39+ 'Content-Length ' => '0 ' ,
4040 ];
4141
4242 /**
@@ -45,7 +45,7 @@ abstract class HttpBaseTest extends \PHPUnit_Framework_TestCase
4545 public static function setUpBeforeClass ()
4646 {
4747 self ::$ logPath = PHPUnitUtility::getFile (true , 'php-http-adapter.log ' );
48- self ::$ messageFactory = MessageFactoryDiscovery:: find ();
48+ self ::$ messageFactory = new GuzzleMessageFactory ();
4949 }
5050
5151 /**
@@ -65,9 +65,9 @@ public function requestProvider()
6565 {
6666 $ sets = [
6767 'methods ' => $ this ->getMethods (),
68- 'uris ' => [$ this ->getUri ()],
68+ 'uris ' => [$ this ->getUri ()],
6969 'headers ' => $ this ->getHeaders (),
70- 'body ' => $ this ->getBodies (),
70+ 'body ' => $ this ->getBodies (),
7171 ];
7272
7373 $ cartesianProduct = new CartesianProduct ($ sets );
@@ -81,10 +81,10 @@ public function requestProvider()
8181 public function requestWithOutcomeProvider ()
8282 {
8383 $ sets = [
84- 'urisAndOutcomes ' => $ this ->getUrisAndOutcomes (),
84+ 'urisAndOutcomes ' => $ this ->getUrisAndOutcomes (),
8585 'protocolVersions ' => $ this ->getProtocolVersions (),
86- 'headers ' => $ this ->getHeaders (),
87- 'body ' => $ this ->getBodies (),
86+ 'headers ' => $ this ->getHeaders (),
87+ 'body ' => $ this ->getBodies (),
8888 ];
8989
9090 $ cartesianProduct = new CartesianProduct ($ sets );
@@ -137,23 +137,23 @@ private function getUrisAndOutcomes()
137137 [
138138 $ this ->getUri (['client_error ' => true ]),
139139 [
140- 'statusCode ' => 400 ,
140+ 'statusCode ' => 400 ,
141141 'reasonPhrase ' => 'Bad Request ' ,
142142 ],
143143 ],
144144 [
145145 $ this ->getUri (['server_error ' => true ]),
146146 [
147- 'statusCode ' => 500 ,
147+ 'statusCode ' => 500 ,
148148 'reasonPhrase ' => 'Internal Server Error ' ,
149149 ],
150150 ],
151151 [
152152 $ this ->getUri (['redirect ' => true ]),
153153 [
154- 'statusCode ' => 302 ,
154+ 'statusCode ' => 302 ,
155155 'reasonPhrase ' => 'Found ' ,
156- 'body ' => 'Redirect ' ,
156+ 'body ' => 'Redirect ' ,
157157 ],
158158 ],
159159 ];
0 commit comments