2
2
3
3
namespace Http \Client \Tests ;
4
4
5
- use Http \Discovery \MessageFactoryDiscovery ;
6
5
use Http \Message \MessageFactory ;
6
+ use Http \Message \MessageFactory \GuzzleMessageFactory ;
7
7
use Nerd \CartesianProduct \CartesianProduct ;
8
8
use Psr \Http \Message \ResponseInterface ;
9
9
@@ -24,10 +24,10 @@ abstract class HttpBaseTest extends \PHPUnit_Framework_TestCase
24
24
*/
25
25
protected $ defaultOptions = [
26
26
'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 ' ,
31
31
];
32
32
33
33
/**
@@ -36,7 +36,7 @@ abstract class HttpBaseTest extends \PHPUnit_Framework_TestCase
36
36
protected $ defaultHeaders = [
37
37
'Connection ' => 'close ' ,
38
38
'User-Agent ' => 'PHP HTTP Adapter ' ,
39
- 'Content-Length ' => '0 '
39
+ 'Content-Length ' => '0 ' ,
40
40
];
41
41
42
42
/**
@@ -45,7 +45,7 @@ abstract class HttpBaseTest extends \PHPUnit_Framework_TestCase
45
45
public static function setUpBeforeClass ()
46
46
{
47
47
self ::$ logPath = PHPUnitUtility::getFile (true , 'php-http-adapter.log ' );
48
- self ::$ messageFactory = MessageFactoryDiscovery:: find ();
48
+ self ::$ messageFactory = new GuzzleMessageFactory ();
49
49
}
50
50
51
51
/**
@@ -65,9 +65,9 @@ public function requestProvider()
65
65
{
66
66
$ sets = [
67
67
'methods ' => $ this ->getMethods (),
68
- 'uris ' => [$ this ->getUri ()],
68
+ 'uris ' => [$ this ->getUri ()],
69
69
'headers ' => $ this ->getHeaders (),
70
- 'body ' => $ this ->getBodies (),
70
+ 'body ' => $ this ->getBodies (),
71
71
];
72
72
73
73
$ cartesianProduct = new CartesianProduct ($ sets );
@@ -81,10 +81,10 @@ public function requestProvider()
81
81
public function requestWithOutcomeProvider ()
82
82
{
83
83
$ sets = [
84
- 'urisAndOutcomes ' => $ this ->getUrisAndOutcomes (),
84
+ 'urisAndOutcomes ' => $ this ->getUrisAndOutcomes (),
85
85
'protocolVersions ' => $ this ->getProtocolVersions (),
86
- 'headers ' => $ this ->getHeaders (),
87
- 'body ' => $ this ->getBodies (),
86
+ 'headers ' => $ this ->getHeaders (),
87
+ 'body ' => $ this ->getBodies (),
88
88
];
89
89
90
90
$ cartesianProduct = new CartesianProduct ($ sets );
@@ -137,23 +137,23 @@ private function getUrisAndOutcomes()
137
137
[
138
138
$ this ->getUri (['client_error ' => true ]),
139
139
[
140
- 'statusCode ' => 400 ,
140
+ 'statusCode ' => 400 ,
141
141
'reasonPhrase ' => 'Bad Request ' ,
142
142
],
143
143
],
144
144
[
145
145
$ this ->getUri (['server_error ' => true ]),
146
146
[
147
- 'statusCode ' => 500 ,
147
+ 'statusCode ' => 500 ,
148
148
'reasonPhrase ' => 'Internal Server Error ' ,
149
149
],
150
150
],
151
151
[
152
152
$ this ->getUri (['redirect ' => true ]),
153
153
[
154
- 'statusCode ' => 302 ,
154
+ 'statusCode ' => 302 ,
155
155
'reasonPhrase ' => 'Found ' ,
156
- 'body ' => 'Redirect ' ,
156
+ 'body ' => 'Redirect ' ,
157
157
],
158
158
],
159
159
];
0 commit comments