OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
API
/
vendor
/
zircote
/
swagger-php
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/07/2024 04:34:03 AM
rwxr-xr-x
📁
Analysers
-
08/07/2024 04:34:31 AM
rwxr-xr-x
📄
AnalysisTest.php
4.09 KB
08/07/2024 04:34:02 AM
rw-r--r--
📁
Annotations
-
08/07/2024 04:34:31 AM
rwxr-xr-x
📄
CommandlineTest.php
2.47 KB
08/07/2024 04:34:02 AM
rw-r--r--
📄
ConstantsTest.php
2.24 KB
08/07/2024 04:34:02 AM
rw-r--r--
📄
ContextTest.php
2.79 KB
08/07/2024 04:34:02 AM
rw-r--r--
📄
ExamplesTest.php
8.22 KB
08/07/2024 04:34:02 AM
rw-r--r--
📁
Fixtures
-
08/07/2024 04:34:54 AM
rwxr-xr-x
📄
GeneratorTest.php
4.71 KB
08/07/2024 04:34:02 AM
rw-r--r--
📄
OpenApiTestCase.php
9.78 KB
08/07/2024 04:34:02 AM
rw-r--r--
📄
PipelineTest.php
2.52 KB
08/07/2024 04:34:03 AM
rw-r--r--
📁
Processors
-
08/07/2024 04:34:33 AM
rwxr-xr-x
📄
RefTest.php
1.08 KB
08/07/2024 04:34:03 AM
rw-r--r--
📁
Samples
-
08/07/2024 04:34:33 AM
rwxr-xr-x
📄
ScratchTest.php
1.94 KB
08/07/2024 04:34:03 AM
rw-r--r--
📄
SerializerTest.php
6.39 KB
08/07/2024 04:34:03 AM
rw-r--r--
📄
UtilTest.php
2.84 KB
08/07/2024 04:34:03 AM
rw-r--r--
📄
cl_bootstrap.php
342 bytes
08/07/2024 04:34:02 AM
rw-r--r--
Editing: ScratchTest.php
Close
<?php declare(strict_types=1); /** * @license Apache 2.0 */ namespace OpenApi\Tests; use OpenApi\Annotations as OA; use OpenApi\Generator; class ScratchTest extends OpenApiTestCase { public static function scratchTests(): iterable { foreach (glob(static::fixture('Scratch/*.php')) as $fixture) { $name = pathinfo($fixture, PATHINFO_FILENAME); if (0 === strpos($name, 'Abstract')) { continue; } $scratch = static::fixture("Scratch/$name.php"); $specs = [ static::fixture("Scratch/{$name}3.1.0.yaml") => OA\OpenApi::VERSION_3_1_0, static::fixture("Scratch/{$name}3.0.0.yaml") => OA\OpenApi::VERSION_3_0_0, ]; $expectedLogs = [ 'Examples-3.0.0' => ['@OA\Schema() is only allowed for 3.1.0'], ]; foreach ($specs as $spec => $version) { if (file_exists($spec)) { $dataSet = "$name-$version"; yield $dataSet => [ $scratch, $spec, $version, array_key_exists($dataSet, $expectedLogs) ? $expectedLogs[$dataSet] : [], ]; } } } } /** * Test scratch fixtures. * * @dataProvider scratchTests * * @requires PHP 8.1 */ public function testScratch(string $scratch, string $spec, string $version, array $expectedLogs): void { foreach ($expectedLogs as $logLine) { $this->assertOpenApiLogEntryContains($logLine); } require_once $scratch; $openapi = (new Generator($this->getTrackingLogger())) ->setVersion($version) ->generate([$scratch]); // file_put_contents($spec, $openapi->toYaml()); $this->assertSpecEquals($openapi, file_get_contents($spec)); } }