updated composer
This commit is contained in:
@@ -29,7 +29,7 @@ foreach ($_SERVER as $k => $v) {
|
||||
}
|
||||
}
|
||||
|
||||
$json = json_encode($vars, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
||||
$json = json_encode($vars, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE);
|
||||
|
||||
switch ($vars['REQUEST_URI']) {
|
||||
default:
|
||||
@@ -111,7 +111,7 @@ switch ($vars['REQUEST_URI']) {
|
||||
break;
|
||||
|
||||
case '/post':
|
||||
$output = json_encode($_POST + ['REQUEST_METHOD' => $vars['REQUEST_METHOD']], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
||||
$output = json_encode($_POST + ['REQUEST_METHOD' => $vars['REQUEST_METHOD']], \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE);
|
||||
header('Content-Type: application/json', true);
|
||||
header('Content-Length: '.strlen($output));
|
||||
echo $output;
|
||||
|
||||
@@ -1038,4 +1038,20 @@ abstract class HttpClientTestCase extends TestCase
|
||||
|
||||
$this->assertLessThan(10, $duration);
|
||||
}
|
||||
|
||||
public function testWithOptions()
|
||||
{
|
||||
$client = $this->getHttpClient(__FUNCTION__);
|
||||
if (!method_exists($client, 'withOptions')) {
|
||||
$this->markTestSkipped(sprintf('Not implementing "%s::withOptions()" is deprecated.', get_debug_type($client)));
|
||||
}
|
||||
|
||||
$client2 = $client->withOptions(['base_uri' => 'http://localhost:8057/']);
|
||||
|
||||
$this->assertNotSame($client, $client2);
|
||||
$this->assertSame(\get_class($client), \get_class($client2));
|
||||
|
||||
$response = $client2->request('GET', '/');
|
||||
$this->assertSame(200, $response->getStatusCode());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user