From a50e2d03928c2e330187772f3d3062696733062d Mon Sep 17 00:00:00 2001 From: soyuka Date: Sat, 7 Sep 2024 08:31:35 +0200 Subject: [PATCH] test: remove hydra prefix from guides --- docs/guides/create-a-custom-doctrine-filter.php | 10 +++++----- docs/guides/custom-pagination.php | 16 ++++++++-------- docs/guides/doctrine-search-filter.php | 10 +++++----- docs/guides/how-to.php | 4 ++-- ...eturn-the-iri-of-your-resources-relations.php | 2 +- docs/guides/test-your-api.php | 2 +- docs/guides/validate-incoming-data.php | 6 +++--- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/docs/guides/create-a-custom-doctrine-filter.php b/docs/guides/create-a-custom-doctrine-filter.php index 32af2c2bf25..1c3c0192098 100644 --- a/docs/guides/create-a-custom-doctrine-filter.php +++ b/docs/guides/create-a-custom-doctrine-filter.php @@ -153,11 +153,11 @@ public function testAsAnonymousICanAccessTheDocumentation(): void $this->assertResponseIsSuccessful(); $this->assertMatchesResourceCollectionJsonSchema(Book::class, '_api_/books{._format}_get_collection'); $this->assertJsonContains([ - 'hydra:search' => [ - '@type' => 'hydra:IriTemplate', - 'hydra:template' => '/books.jsonld{?regexp_title,regexp_author}', - 'hydra:variableRepresentation' => 'BasicRepresentation', - 'hydra:mapping' => [ + 'search' => [ + '@type' => 'IriTemplate', + 'template' => '/books.jsonld{?regexp_title,regexp_author}', + 'variableRepresentation' => 'BasicRepresentation', + 'mapping' => [ [ '@type' => 'IriTemplateMapping', 'variable' => 'regexp_title', diff --git a/docs/guides/custom-pagination.php b/docs/guides/custom-pagination.php index 85187f5c0c8..a83bac18724 100644 --- a/docs/guides/custom-pagination.php +++ b/docs/guides/custom-pagination.php @@ -7,7 +7,7 @@ // tags: expert // --- -// In case you're using a custom collection (through a Provider), make sure you return the `Paginator` object to get the full hydra response with `hydra:view` (which contains information about first, last, next and previous page). +// In case you're using a custom collection (through a Provider), make sure you return the `Paginator` object to get the full hydra response with `view` (which contains information about first, last, next and previous page). // // The following example shows how to handle it using a custom Provider. You will need to use the Doctrine Paginator and pass it to the API Platform Paginator. @@ -160,15 +160,15 @@ public function testTheCustomCollectionIsPaginated(): void $this->assertResponseIsSuccessful(); $this->assertMatchesResourceCollectionJsonSchema(Book::class, '_api_/books{._format}_get_collection', 'jsonld'); - $this->assertNotSame(0, $response->toArray(false)['hydra:totalItems'], 'The collection is empty.'); + $this->assertNotSame(0, $response->toArray(false)['totalItems'], 'The collection is empty.'); $this->assertJsonContains([ - 'hydra:totalItems' => 35, - 'hydra:view' => [ + 'totalItems' => 35, + 'view' => [ '@id' => '/books.jsonld?page=1', - '@type' => 'hydra:PartialCollectionView', - 'hydra:first' => '/books.jsonld?page=1', - 'hydra:last' => '/books.jsonld?page=2', - 'hydra:next' => '/books.jsonld?page=2', + '@type' => 'PartialCollectionView', + 'first' => '/books.jsonld?page=1', + 'last' => '/books.jsonld?page=2', + 'next' => '/books.jsonld?page=2', ], ]); } diff --git a/docs/guides/doctrine-search-filter.php b/docs/guides/doctrine-search-filter.php index 331c494f50f..14287554fb4 100644 --- a/docs/guides/doctrine-search-filter.php +++ b/docs/guides/doctrine-search-filter.php @@ -118,11 +118,11 @@ public function testGetDocumentation(): void $this->assertResponseIsSuccessful(); $this->assertMatchesResourceCollectionJsonSchema(Book::class, '_api_books{._format}_get_collection', 'jsonld'); $this->assertJsonContains([ - 'hydra:search' => [ - '@type' => 'hydra:IriTemplate', - 'hydra:template' => '/books.jsonld{?id,title,author}', - 'hydra:variableRepresentation' => 'BasicRepresentation', - 'hydra:mapping' => [ + 'search' => [ + '@type' => 'IriTemplate', + 'template' => '/books.jsonld{?id,title,author}', + 'variableRepresentation' => 'BasicRepresentation', + 'mapping' => [ [ '@type' => 'IriTemplateMapping', 'variable' => 'id', diff --git a/docs/guides/how-to.php b/docs/guides/how-to.php index d9999dac1a9..79aaa2a99c1 100644 --- a/docs/guides/how-to.php +++ b/docs/guides/how-to.php @@ -137,9 +137,9 @@ public function testAsAnonymousICanAccessTheDocumentation(): void $this->assertResponseIsSuccessful(); $this->assertMatchesResourceCollectionJsonSchema(Book::class, '_api_/books{._format}_get_collection', 'jsonld'); - $this->assertNotSame(0, $response->toArray(false)['hydra:totalItems'], 'The collection is empty.'); + $this->assertNotSame(0, $response->toArray(false)['totalItems'], 'The collection is empty.'); $this->assertJsonContains([ - 'hydra:totalItems' => 10, + 'totalItems' => 10, ]); } } diff --git a/docs/guides/return-the-iri-of-your-resources-relations.php b/docs/guides/return-the-iri-of-your-resources-relations.php index e8fec5cb639..41fb3b779a9 100644 --- a/docs/guides/return-the-iri-of-your-resources-relations.php +++ b/docs/guides/return-the-iri-of-your-resources-relations.php @@ -157,7 +157,7 @@ public function setBrand(Brand $brand): void // // The **OpenAPI** documentation will set the properties as `read-only` of type `string` in the format `iri-reference` for `JSON-LD`, `JSON:API` and `HAL` formats. // -// The **Hydra** documentation will set the properties as `hydra:Link` with the right domain, with `hydra:readable` to `true` but `hydra:writable` to `false`. +// The **Hydra** documentation will set the properties as `Link` with the right domain, with `readable` to `true` but `writable` to `false`. // // When using JSON:API or HAL formats, the IRI will be used and set links, embedded and relationship. // diff --git a/docs/guides/test-your-api.php b/docs/guides/test-your-api.php index 7749ccc920c..c0fea83ace5 100644 --- a/docs/guides/test-your-api.php +++ b/docs/guides/test-your-api.php @@ -39,7 +39,7 @@ public function testGetCollection(): void // matches an expected format, for example here with a collection. $this->assertMatchesResourceCollectionJsonSchema(Book::class); // PHPUnit default assertions are also available. - $this->assertCount(0, $response->toArray()['hydra:member']); + $this->assertCount(0, $response->toArray()['member']); } } } diff --git a/docs/guides/validate-incoming-data.php b/docs/guides/validate-incoming-data.php index 2b8bbed03b2..afefd71189a 100644 --- a/docs/guides/validate-incoming-data.php +++ b/docs/guides/validate-incoming-data.php @@ -139,8 +139,8 @@ public function testValidation(): void // { // "@context": "/contexts/ConstraintViolationList", // "@type": "ConstraintViolationList", - // "hydra:title": "An error occurred", - // "hydra:description": "properties: The product must have the minimal properties required (\"description\", \"price\")", + // "title": "An error occurred", + // "description": "properties: The product must have the minimal properties required (\"description\", \"price\")", // "violations": [ // { // "propertyPath": "properties", @@ -151,7 +151,7 @@ public function testValidation(): void // ``` $this->assertResponseStatusCodeSame(422); $this->assertJsonContains([ - 'hydra:description' => 'properties: The product must have the minimal properties required ("description", "price")', + 'description' => 'properties: The product must have the minimal properties required ("description", "price")', 'title' => 'An error occurred', 'violations' => [ ['propertyPath' => 'properties', 'message' => 'The product must have the minimal properties required ("description", "price")'],