-
Notifications
You must be signed in to change notification settings - Fork 937
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Order is import here as cleanup of tags can only happen after `CleanUnusedComponents` has run.
- Loading branch information
1 parent
2a6fa1d
commit 0840dad
Showing
5 changed files
with
63 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* @license Apache 2.0 | ||
*/ | ||
|
||
namespace OpenApi\Tests\Fixtures; | ||
|
||
use OpenApi\Attributes as OAT; | ||
|
||
#[OAT\OpenApi( | ||
info: new OAT\Info( | ||
title: 'test', | ||
description: 'test', | ||
version: '2.0.0' | ||
), | ||
)] | ||
class SurplusTag | ||
{ | ||
#[OAT\Get(path: '/world/', tags: ['tag world'], responses: [new OAT\Response(response: '200', description: 'success')])] | ||
#[OAT\Get(path: '/hello/', tags: ['tag hello'], responses: [new OAT\Response(response: '200', description: 'success')])] | ||
public function hello(): void | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* @license Apache 2.0 | ||
*/ | ||
|
||
namespace OpenApi\Tests\Processors; | ||
|
||
use OpenApi\Tests\OpenApiTestCase; | ||
|
||
class AugmentTagsTest extends OpenApiTestCase | ||
{ | ||
/** | ||
* @requires PHP 8.1 | ||
*/ | ||
public function testAugmentTags(): void | ||
{ | ||
$this->skipLegacy(); | ||
|
||
$config = [ | ||
'pathFilter' => ['paths' => ['#^/hello/#']], | ||
'cleanUnusedComponents' => ['enabled' => true], | ||
]; | ||
$analysis = $this->analysisFromFixtures(['SurplusTag.php'], static::processors(), null, $config); | ||
|
||
$this->assertCount(1, $analysis->openapi->tags); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters