Skip to content

Commit cd2e35c

Browse files
authored
Update OpenApi PathItem nullable operation test (#4122)
1 parent c3385d2 commit cd2e35c

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

tests/OpenApi/Factory/OpenApiFactoryTest.php

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
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;
3433
use ApiPlatform\Core\OpenApi\OpenApi;
3534
use ApiPlatform\Core\OpenApi\Options;
3635
use ApiPlatform\Core\OpenApi\Serializer\OpenApiNormalizer;
@@ -749,17 +748,21 @@ public function testSubresourceDocumentation()
749748

750749
public function testResetPathItem()
751750
{
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());
751+
$pathItem = new Model\PathItem(
752+
null,
753+
'',
754+
'',
755+
new Model\Operation(),
756+
new Model\Operation(),
757+
new Model\Operation(),
758+
new Model\Operation(),
759+
new Model\Operation()
760+
);
761+
762+
$this->assertNull($pathItem->withGet(null)->getGet());
763+
$this->assertNull($pathItem->withDelete(null)->getDelete());
764+
$this->assertNull($pathItem->withPost(null)->getPost());
765+
$this->assertNull($pathItem->withPut(null)->getPut());
766+
$this->assertNull($pathItem->withPatch(null)->getPatch());
764767
}
765768
}

0 commit comments

Comments
 (0)