Skip to content

Commit

Permalink
test operation id
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Aug 21, 2024
1 parent 2848c5e commit 47f1553
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/Parser/Attribute/PropertyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use PSX\Api\Attribute\Description;
use PSX\Api\Attribute\Get;
use PSX\Api\Attribute\Header;
use PSX\Api\Attribute\OperationId;
use PSX\Api\Attribute\Param;
use PSX\Api\Attribute\Path;
use PSX\Api\Attribute\Query;
Expand All @@ -43,6 +44,7 @@ class PropertyController
{
#[Get]
#[Path('/foo/:fooId')]
#[OperationId('my.operation')]
#[Description('Test description')]
protected function doGet(
#[Header('Content-Type')] string $contentType,
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/AttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function testParseInvalid()
public function testParseProperty()
{
$specification = $this->apiManager->getApi(PropertyController::class);
$operation = $specification->getOperations()->get('PSX.Api.Tests.Parser.Attribute.PropertyController.doGet');
$operation = $specification->getOperations()->get('my.operation');

$this->assertInstanceOf(OperationInterface::class, $operation);
$this->assertEquals('Test description', $operation->getDescription());
Expand Down

0 comments on commit 47f1553

Please sign in to comment.