-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathIssueTest.php
More file actions
34 lines (29 loc) · 1.25 KB
/
IssueTest.php
File metadata and controls
34 lines (29 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
use cebe\openapi\Reader;
use cebe\openapi\spec\OpenApi;
class IssueTest extends \PHPUnit\Framework\TestCase
{
// https://github.com/cebe/php-openapi/issues/175
public function test175UnableToReferenceOtherLocalJsonFile()
{
$openapi = Reader::readFromJsonFile(__DIR__.'/data/issue/175/spec.json');
$this->assertInstanceOf(\cebe\openapi\SpecObjectInterface::class, $openapi);
}
// https://github.com/cebe/php-openapi/issues/224
public function test224FailsOnLargeDefinitions()
{
$openapi = Reader::readFromJsonFile(__DIR__.'/data/issue/224/cloudflare.json');
$this->readLargeFiles($openapi);
// $openapiYml = Reader::readFromYamlFile(__DIR__.'/data/issue/224/cloudflare.yml');
// $this->readLargeFiles($openapiYml);
}
private function readLargeFiles(OpenApi $openapi): void
{
$this->assertInstanceOf(\cebe\openapi\SpecObjectInterface::class, $openapi);
$this->assertSame($openapi->openapi, '3.0.3');
$this->assertSame(
$openapi->paths->getPath('/memberships')->getOperations()['get']->responses['4XX']->content['application/json']->schema->properties['success']->description,
'Whether the API call was successful.'
);
}
}