Skip to content

Commit

Permalink
fix: replace ConstraintViolationList by ConstraintViolation in PHPUni…
Browse files Browse the repository at this point in the history
…t tests
  • Loading branch information
vincentchalamon committed Feb 12, 2025
1 parent c973953 commit 832cb6e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions api/tests/Api/Admin/BookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public static function getInvalidDataOnCreate(): iterable
[],
Response::HTTP_UNPROCESSABLE_ENTITY,
[
'@type' => 'ConstraintViolationList',
'@type' => 'ConstraintViolation',
'title' => 'An error occurred',
'violations' => [
[
Expand All @@ -315,7 +315,7 @@ public static function getInvalidData(): iterable
],
Response::HTTP_UNPROCESSABLE_ENTITY,
[
'@type' => 'ConstraintViolationList',
'@type' => 'ConstraintViolation',
'title' => 'An error occurred',
'description' => 'condition: This value should be of type ' . BookCondition::class . '.',
'violations' => [
Expand All @@ -333,7 +333,7 @@ public static function getInvalidData(): iterable
],
Response::HTTP_UNPROCESSABLE_ENTITY,
[
'@type' => 'ConstraintViolationList',
'@type' => 'ConstraintViolation',
'title' => 'An error occurred',
'description' => 'condition: This value should be of type ' . BookCondition::class . '.',
'violations' => [
Expand All @@ -351,7 +351,7 @@ public static function getInvalidData(): iterable
],
Response::HTTP_UNPROCESSABLE_ENTITY,
[
'@type' => 'ConstraintViolationList',
'@type' => 'ConstraintViolation',
'title' => 'An error occurred',
'violations' => [
[
Expand Down
4 changes: 2 additions & 2 deletions api/tests/Api/BookmarkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function asAUserICannotCreateABookmarkWithInvalidData(): void
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
self::assertJsonContains([
'@type' => 'ConstraintViolationList',
'@type' => 'ConstraintViolation',
'title' => 'An error occurred',
'description' => 'book: This value should be of type ' . Book::class . '.',
'violations' => [
Expand Down Expand Up @@ -218,7 +218,7 @@ public function asAUserICannotCreateADuplicateBookmark(): void
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
self::assertJsonContains([
'@type' => 'ConstraintViolationList',
'@type' => 'ConstraintViolation',
'title' => 'An error occurred',
'description' => 'You have already bookmarked this book.',
]);
Expand Down
4 changes: 2 additions & 2 deletions api/tests/Api/ReviewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public static function getInvalidData(): iterable
[],
Response::HTTP_UNPROCESSABLE_ENTITY,
[
'@type' => 'ConstraintViolationList',
'@type' => 'ConstraintViolation',
'title' => 'An error occurred',
'violations' => [
[
Expand Down Expand Up @@ -325,7 +325,7 @@ public function asAUserICannotAddADuplicateReviewOnABook(): void
self::assertResponseHeaderSame('content-type', 'application/problem+json; charset=utf-8');
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
self::assertJsonContains([
'@type' => 'ConstraintViolationList',
'@type' => 'ConstraintViolation',
'title' => 'An error occurred',
'description' => 'You have already reviewed this book.',
]);
Expand Down

0 comments on commit 832cb6e

Please sign in to comment.