Skip to content

Commit 576754f

Browse files
committed
Adapt test to work on php 5.4
1 parent d59d7ed commit 576754f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "php-http/socket-client",
33
"description": "Socket client for PHP-HTTP",
44
"require": {
5+
"php": ">=5.4",
56
"symfony/options-resolver": "^2.7",
67
"php-http/httplug": "^1.0@dev",
78
"php-http/message-factory": "dev-master as 0.1.1",

tests/SocketHttpClientTest.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Http\Client\Utils\HttpMethodsClient;
66
use Http\Discovery\MessageFactory\GuzzleFactory;
77
use Http\Socket\SocketHttpClient;
8-
use Psr\Http\Message\ResponseInterface;
98

109
class SocketHttpClientTest extends BaseTestCase
1110
{
@@ -22,7 +21,7 @@ public function testTcpSocketDomain()
2221
$client = $this->createClient(['remote_socket' => '127.0.0.1:19999']);
2322
$response = $client->get('/', []);
2423

25-
$this->assertInstanceOf(ResponseInterface::class, $response);
24+
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
2625
$this->assertEquals(200, $response->getStatusCode());
2726
}
2827

@@ -41,7 +40,7 @@ public function testRemoteInUri()
4140
$client = $this->createClient();
4241
$response = $client->get('http://127.0.0.1:19999/', []);
4342

44-
$this->assertInstanceOf(ResponseInterface::class, $response);
43+
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
4544
$this->assertEquals(200, $response->getStatusCode());
4645
}
4746

@@ -51,7 +50,7 @@ public function testRemoteInHostHeader()
5150
$client = $this->createClient();
5251
$response = $client->get('/', ['Host' => '127.0.0.1:19999']);
5352

54-
$this->assertInstanceOf(ResponseInterface::class, $response);
53+
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
5554
$this->assertEquals(200, $response->getStatusCode());
5655
}
5756

@@ -78,7 +77,7 @@ public function testSslRemoteInUri()
7877
]);
7978
$response = $client->get('https://127.0.0.1:19999/', []);
8079

81-
$this->assertInstanceOf(ResponseInterface::class, $response);
80+
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
8281
$this->assertEquals(200, $response->getStatusCode());
8382
}
8483

@@ -91,7 +90,7 @@ public function testUnixSocketDomain()
9190
]);
9291
$response = $client->get('/', []);
9392

94-
$this->assertInstanceOf(ResponseInterface::class, $response);
93+
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
9594
$this->assertEquals(200, $response->getStatusCode());
9695
}
9796

@@ -120,7 +119,7 @@ public function testSslConnection()
120119
]);
121120
$response = $client->get('/', []);
122121

123-
$this->assertInstanceOf(ResponseInterface::class, $response);
122+
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
124123
$this->assertEquals(200, $response->getStatusCode());
125124
}
126125

@@ -145,7 +144,7 @@ public function testSslConnectionWithClientCertificate()
145144
]);
146145
$response = $client->get('/', []);
147146

148-
$this->assertInstanceOf(ResponseInterface::class, $response);
147+
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
149148
$this->assertEquals(200, $response->getStatusCode());
150149
}
151150

@@ -169,7 +168,7 @@ public function testInvalidSslConnectionWithClientCertificate()
169168
]);
170169
$response = $client->get('/', []);
171170

172-
$this->assertInstanceOf(ResponseInterface::class, $response);
171+
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
173172
$this->assertEquals(403, $response->getStatusCode());
174173
}
175174

0 commit comments

Comments
 (0)