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 1d87a9a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
10 changes: 2 additions & 8 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. <egetick@gmail.com>
*/
#[
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
8 changes: 4 additions & 4 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

0 comments on commit 1d87a9a

Please sign in to comment.