* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class ApiManagerTest extends ApiManagerTestCase { public function testGetApiAnnotation() { $specification = $this->apiManager->getApi(TestController::class, '/foo'); $this->assertInstanceOf(SpecificationInterface::class, $specification); } public function testGetApiOpenAPI() { $specification = $this->apiManager->getApi(__DIR__ . '/Parser/openapi/test.json', '/foo/:fooId'); $this->assertInstanceOf(SpecificationInterface::class, $specification); } public function testGetApiFileDoesNotExist() { $this->expectException(\RuntimeException::class); $this->apiManager->getApi(__DIR__ . '/Parser/openapi/unknown.json', '/foo/:fooId'); } public function testGetApiInvalidType() { $this->expectException(\RuntimeException::class); $this->apiManager->getApi('', '/foo', 12); } public function testGetBuilder() { $builder = $this->apiManager->getBuilder(Resource::STATUS_ACTIVE, '/foo'); $builder->setTitle('My_Resource'); $builder->setDescription('My super resource'); $builder->setPathParameters('Path')->addInteger('todo_id'); $builder->setTags(['my_tag']); $post = $builder->addMethod('POST'); $post->setOperationId('my_action'); $post->setQueryParameters('PostQuery')->addInteger('startIndex'); $post->setDescription('My method description'); $post->setRequest(__DIR__ . '/Parser/schema/schema.json'); $post->addResponse(200, __DIR__ . '/Parser/schema/schema.json'); $post->setSecurity('OAuth2', ['foo']); $post->setTags(['my_tag']); $specification = $builder->getSpecification(); $this->assertInstanceOf(SpecificationInterface::class, $specification); } } __halt_compiler();----SIGNATURE:----arjL2xqDnyOMV3uLzM3oFn0y6c1r/r1JvJloOwaVjnfZ+IEZ0w3OADxQDXQ43gKL9vVpPhJnBQxilV0o9lpi+EteHJH9i9MEGBVkxdJtS6LQag7au5okgAb1G1yf+vhaActABa0JPAIav++C3eQAngyOeQBdV8nPw49c02V49dEAaH3QcVrE6raZ8OLPcNpi/JM7or9I8L6gjEJhYWLreFZkoqr1iK1k+jQZIvs+/4o1f+15NIlJHAmKkfvEbH1mfzQP5ky638TuM5uT9NiK9xXcaOC0gYY69Dd+XMW+4t74duSYOvodLSMUz4mo8/M2nRlrjRfS6q+cryCwGjx+G+owmTf+LIGob5OjE0SFdrt7NE0i+AKwgmGUYFhVnYrnyVZsnuePTyNpFqHvQqpRWSJ2YO8HvXPQ1Bp2P3dU04BjHYk1HR1+UAuPNE/+vlzmZ5vXOJX5ozWFaIXPhpNYMNz8ulBPGgHBir9qQCyjGRmTYohPtkEDX1EvOWK1quzwkSVDxdluXhHIX6i1l6yqL39GIuRyFkHu+nOS4HWOdb2kot7xMhrlonuo3BQYZcYXoPEKvBn2uEz+TxkpnXOyOpvUxE3ZXAUPCEkNZtoDXrY1pk0KFoqB70Alnk0M/b72mlRf1ng9ImZPt4rE3IY+bPQyapIKDj5gXokT/7vWh+4=----ATTACHMENT:----Mzc5NTQwMDY4NTQ2Njc4MCAzODYyNDA3MTAxMzI5MDQ3IDc4ODYwOTgxNDkyMDc0NjY=