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: CommandlineTest.php
Close
<?php declare(strict_types=1); /** * @license Apache 2.0 */ namespace OpenApi\Tests; class CommandlineTest extends OpenApiTestCase { public function testStdout(): void { $path = $this->example('swagger-spec/petstore-simple'); exec(__DIR__ . '/../bin/openapi --bootstrap ' . __DIR__ . '/cl_bootstrap.php --format yaml ' . escapeshellarg($path) . ' 2> /dev/null', $output, $retval); $this->assertSame(0, $retval, implode(PHP_EOL, $output)); $yaml = implode(PHP_EOL, $output); $this->assertSpecEquals(file_get_contents($path . '/petstore-simple.yaml'), $yaml); } public function testOutputTofile(): void { $path = $this->example('swagger-spec/petstore-simple'); $filename = sys_get_temp_dir() . '/swagger-php-clitest.yaml'; exec(__DIR__ . '/../bin/openapi --bootstrap ' . __DIR__ . '/cl_bootstrap.php --format yaml -o ' . escapeshellarg($filename) . ' ' . escapeshellarg($path) . ' 2> /dev/null', $output, $retval); $this->assertSame(0, $retval, implode(PHP_EOL, $output)); $this->assertCount(0, $output, 'No output to stdout'); $yaml = file_get_contents($filename); unlink($filename); $this->assertSpecEquals(file_get_contents($path . '/petstore-simple.yaml'), $yaml); } public function testAddProcessor(): void { $path = $this->example('swagger-spec/petstore-simple'); $cmd = __DIR__ . '/../bin/openapi --bootstrap ' . __DIR__ . '/cl_bootstrap.php --processor OperationId --format yaml ' . escapeshellarg($path); exec($cmd . ' 2> /dev/null', $output, $retval); $this->assertSame(0, $retval, $cmd . PHP_EOL . implode(PHP_EOL, $output)); } public function testExcludeListWarning(): void { $path = $this->example('swagger-spec/petstore-simple'); exec(__DIR__ . '/../bin/openapi -e foo,bar ' . escapeshellarg($path) . ' 2>&1', $output, $retval); $this->assertSame(1, $retval); $output = implode(PHP_EOL, $output); $this->assertStringContainsString('Comma-separated exclude paths are deprecated', $output); } public function testMissingArg(): void { $path = $this->example('swagger-spec/petstore-simple'); exec(__DIR__ . '/../bin/openapi ' . escapeshellarg($path) . ' -e 2>&1', $output, $retval); $this->assertSame(1, $retval); $output = implode(PHP_EOL, $output); $this->assertStringContainsString('Error: Missing argument for "-e"', $output); } }