Skip to content

Commit c25f961

Browse files
committed
OpenAPI PathItem Add test nullable operation
1 parent 3e742ff commit c25f961

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/OpenApi/Factory/OpenApiFactoryTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use ApiPlatform\Core\Metadata\Resource\ResourceNameCollection;
3131
use ApiPlatform\Core\OpenApi\Factory\OpenApiFactory;
3232
use ApiPlatform\Core\OpenApi\Model;
33+
use ApiPlatform\Core\OpenApi\Model\PathItem;
3334
use ApiPlatform\Core\OpenApi\OpenApi;
3435
use ApiPlatform\Core\OpenApi\Options;
3536
use ApiPlatform\Core\OpenApi\Serializer\OpenApiNormalizer;
@@ -745,4 +746,20 @@ public function testSubresourceDocumentation()
745746
$normalizer = new OpenApiNormalizer($normalizers[0]);
746747
$normalizer->normalize($openApi);
747748
}
749+
750+
public function testResetPathItem()
751+
{
752+
$pathItem = new PathItem();
753+
$pathItem->withGet(null);
754+
$pathItem->withDelete(null);
755+
$pathItem->withPost(null);
756+
$pathItem->withPut(null);
757+
$pathItem->withPatch(null);
758+
759+
$this->assertNull($pathItem->getGet());
760+
$this->assertNull($pathItem->getDelete());
761+
$this->assertNull($pathItem->getPost());
762+
$this->assertNull($pathItem->getPut());
763+
$this->assertNull($pathItem->getPatch());
764+
}
748765
}

0 commit comments

Comments
 (0)