You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
912 B
35 lines
912 B
<?php declare(strict_types=1);
|
|
|
|
/**
|
|
* @license Apache 2.0
|
|
*/
|
|
|
|
namespace OpenApi\Tests\Processors;
|
|
|
|
use OpenApi\Analysis;
|
|
use OpenApi\Annotations\Info;
|
|
use OpenApi\Annotations\OpenApi;
|
|
use OpenApi\Processors\MergeIntoOpenApi;
|
|
use OpenApi\Tests\OpenApiTestCase;
|
|
use const OpenApi\UNDEFINED;
|
|
|
|
class MergeIntoOpenApiTest extends OpenApiTestCase
|
|
{
|
|
public function testProcessor()
|
|
{
|
|
$openapi = new OpenApi([]);
|
|
$info = new Info([]);
|
|
$analysis = new Analysis(
|
|
[
|
|
$openapi,
|
|
$info,
|
|
]
|
|
);
|
|
$this->assertSame($openapi, $analysis->openapi);
|
|
$this->assertSame(UNDEFINED, $openapi->info);
|
|
$analysis->process(new MergeIntoOpenApi());
|
|
$this->assertSame($openapi, $analysis->openapi);
|
|
$this->assertSame($info, $openapi->info);
|
|
$this->assertCount(0, $analysis->unmerged()->annotations);
|
|
}
|
|
}
|
|
|