Merge branch '0.9.x' into feat-sb-collection
This commit is contained in:
commit
0b4a840161
|
@ -94,33 +94,33 @@ class HTTPTest extends Scope
|
||||||
$this->assertStringContainsString('# robotstxt.org/', $response['body']);
|
$this->assertStringContainsString('# robotstxt.org/', $response['body']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSpecSwagger2()
|
// public function testSpecSwagger2()
|
||||||
{
|
// {
|
||||||
$response = $this->client->call(Client::METHOD_GET, '/specs/swagger2?platform=client', [
|
// $response = $this->client->call(Client::METHOD_GET, '/specs/swagger2?platform=client', [
|
||||||
'content-type' => 'application/json',
|
// 'content-type' => 'application/json',
|
||||||
], []);
|
// ], []);
|
||||||
|
|
||||||
if(!file_put_contents(__DIR__ . '/../../resources/swagger2.json', json_encode($response['body']))) {
|
// if(!file_put_contents(__DIR__ . '/../../resources/swagger2.json', json_encode($response['body']))) {
|
||||||
throw new Exception('Failed to save spec file');
|
// throw new Exception('Failed to save spec file');
|
||||||
}
|
// }
|
||||||
|
|
||||||
$client = new Client();
|
// $client = new Client();
|
||||||
$client->setEndpoint('https://validator.swagger.io');
|
// $client->setEndpoint('https://validator.swagger.io');
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* Test for SUCCESS
|
// * Test for SUCCESS
|
||||||
*/
|
// */
|
||||||
$response = $client->call(Client::METHOD_POST, '/validator/debug', [
|
// $response = $client->call(Client::METHOD_POST, '/validator/debug', [
|
||||||
'content-type' => 'application/json',
|
// 'content-type' => 'application/json',
|
||||||
], json_decode(file_get_contents(realpath(__DIR__ . '/../../resources/swagger2.json')), true));
|
// ], json_decode(file_get_contents(realpath(__DIR__ . '/../../resources/swagger2.json')), true));
|
||||||
|
|
||||||
$response['body'] = json_decode($response['body'], true);
|
// $response['body'] = json_decode($response['body'], true);
|
||||||
|
|
||||||
$this->assertEquals(200, $response['headers']['status-code']);
|
// $this->assertEquals(200, $response['headers']['status-code']);
|
||||||
$this->assertTrue(empty($response['body']));
|
// $this->assertTrue(empty($response['body']));
|
||||||
|
|
||||||
unlink(realpath(__DIR__ . '/../../resources/swagger2.json'));
|
// unlink(realpath(__DIR__ . '/../../resources/swagger2.json'));
|
||||||
}
|
// }
|
||||||
|
|
||||||
public function testSpecOpenAPI3()
|
public function testSpecOpenAPI3()
|
||||||
{
|
{
|
||||||
|
@ -209,4 +209,4 @@ class HTTPTest extends Scope
|
||||||
$this->assertIsString($body['server-ruby']);
|
$this->assertIsString($body['server-ruby']);
|
||||||
$this->assertIsString($body['server-cli']);
|
$this->assertIsString($body['server-cli']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue