Skip to content

Commit

Permalink
fix api platform test
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Oct 24, 2024
1 parent 3f833b3 commit b5c58af
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 24 deletions.
12 changes: 3 additions & 9 deletions tests/Functional/Entity/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@

namespace Nelmio\ApiDocBundle\Tests\Functional\Entity;

use ApiPlatform\Core\Annotation\ApiProperty;
use Nelmio\ApiDocBundle\Tests\Functional\EntityExcluded;

// BC Api-Platform < 3.x
if (!class_exists(ApiProperty::class)) {
class Dummy extends EntityExcluded\ApiPlatform3\Dummy
{
}
} else {
class_alias(EntityExcluded\ApiPlatform2\Dummy::class, Dummy::class);
}
class Dummy extends EntityExcluded\ApiPlatform3\Dummy
{
}
18 changes: 8 additions & 10 deletions tests/Functional/EntityExcluded/ApiPlatform3/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@
/**
* @author Guilhem N. <[email protected]>
*/
#[
ApiResource(
operations: [
new Get(name: 'get'),
new Get(name: 'custom2', uriTemplate: '/foo'),
new Post(name: 'custom', uriTemplate: '/foo'),
new GetCollection(),
],
)
]
#[ApiResource(
operations: [
new Get(name: 'get'),
new Get(name: 'custom2', uriTemplate: '/foo'),
new Post(name: 'custom', uriTemplate: '/foo'),
new GetCollection(),
],
)]
class Dummy
{
/**
Expand Down
10 changes: 5 additions & 5 deletions tests/Functional/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ public function testDeprecatedAction(): void

public function testApiPlatform(): void
{
$operation = $this->getOperation('/api/dummies', 'get');
$operation = $this->getOperation('/api/foo', 'get');
$operation = $this->getOperation('/api/foo', 'post');
$operation = $this->getOperation('/api/dummies/{id}', 'get');
$this->getOperation('/api/dummies', 'get');
$this->getOperation('/api/foo', 'get');
$this->getOperation('/api/foo', 'post');
$this->getOperation('/api/dummies/{id}', 'get');
}

public function testUserModel(): void
Expand Down Expand Up @@ -236,7 +236,7 @@ public function testUserModel(): void
'type' => 'array',
],
'dummy' => [
'$ref' => '#/components/schemas/Dummy2',
'$ref' => '#/components/schemas/Dummy',
],
'status' => [
'type' => 'string',
Expand Down

0 comments on commit b5c58af

Please sign in to comment.