Skip to content

Commit

Permalink
test: update api-platform/core dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon committed Aug 23, 2023
1 parent 61eba76 commit ae6daab
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 33 deletions.
8 changes: 1 addition & 7 deletions api/composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
{
"type": "project",
"license": "MIT",
"repositories": [
{
"type": "vcs",
"url": "git@github.com:vincentchalamon/core.git"
}
],
"require": {
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-xml": "*",
"api-platform/core": "dev-demo",
"api-platform/core": "3.1.x-dev",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/orm": "^2.12",
Expand Down
42 changes: 19 additions & 23 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 ae6daab

Please sign in to comment.