Skip to content

Commit

Permalink
test: test fix from @soyuka
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon committed Aug 22, 2023
1 parent 61eba76 commit f748c9d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions api/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/src/Entity/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use ApiPlatform\Metadata\Patch;
use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Put;
use ApiPlatform\State\CreateProvider;
use App\Repository\ReviewRepository;
use App\Serializer\IriTransformerNormalizer;
use App\State\Processor\ReviewPersistProcessor;
Expand Down Expand Up @@ -86,6 +87,7 @@
security: 'is_granted("ROLE_USER")',
// Mercure publish is done manually in MercureProcessor through ReviewPersistProcessor
processor: ReviewPersistProcessor::class,
provider: CreateProvider::class,
itemUriTemplate: '/books/{bookId}/reviews/{id}{._format}'
),
new Patch(
Expand Down
3 changes: 0 additions & 3 deletions api/tests/Api/ReviewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ public function testAsAnonymousICannotAddAReviewOnABook(): void

$this->client->request('POST', '/books/'.$book->getId().'/reviews', [
'json' => [
'book' => '/books/'.$book->getId(),
'body' => 'Very good book!',
'rating' => 5,
],
Expand Down Expand Up @@ -239,7 +238,6 @@ public function testAsAUserICannotAddAReviewWithValidDataOnAnInvalidBook(): void
$this->client->request('POST', '/books/invalid/reviews', [
'auth_bearer' => $token,
'json' => [
'book' => '/books/'.$book->getId(),
'body' => 'Very good book!',
'rating' => 5,
],
Expand Down Expand Up @@ -272,7 +270,6 @@ public function testAsAUserICanAddAReviewOnABook(): void
$response = $this->client->request('POST', '/books/'.$book->getId().'/reviews', [
'auth_bearer' => $token,
'json' => [
'book' => '/books/'.$book->getId(),
'body' => 'Very good book!',
'rating' => 5,
],
Expand Down

0 comments on commit f748c9d

Please sign in to comment.