Skip to content

Commit a50e2d0

Browse files
committed
test: remove hydra prefix from guides
1 parent f8d0cdc commit a50e2d0

7 files changed

+25
-25
lines changed

docs/guides/create-a-custom-doctrine-filter.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ public function testAsAnonymousICanAccessTheDocumentation(): void
153153
$this->assertResponseIsSuccessful();
154154
$this->assertMatchesResourceCollectionJsonSchema(Book::class, '_api_/books{._format}_get_collection');
155155
$this->assertJsonContains([
156-
'hydra:search' => [
157-
'@type' => 'hydra:IriTemplate',
158-
'hydra:template' => '/books.jsonld{?regexp_title,regexp_author}',
159-
'hydra:variableRepresentation' => 'BasicRepresentation',
160-
'hydra:mapping' => [
156+
'search' => [
157+
'@type' => 'IriTemplate',
158+
'template' => '/books.jsonld{?regexp_title,regexp_author}',
159+
'variableRepresentation' => 'BasicRepresentation',
160+
'mapping' => [
161161
[
162162
'@type' => 'IriTemplateMapping',
163163
'variable' => 'regexp_title',

docs/guides/custom-pagination.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// tags: expert
88
// ---
99

10-
// 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).
10+
// 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).
1111
//
1212
// 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.
1313

@@ -160,15 +160,15 @@ public function testTheCustomCollectionIsPaginated(): void
160160

161161
$this->assertResponseIsSuccessful();
162162
$this->assertMatchesResourceCollectionJsonSchema(Book::class, '_api_/books{._format}_get_collection', 'jsonld');
163-
$this->assertNotSame(0, $response->toArray(false)['hydra:totalItems'], 'The collection is empty.');
163+
$this->assertNotSame(0, $response->toArray(false)['totalItems'], 'The collection is empty.');
164164
$this->assertJsonContains([
165-
'hydra:totalItems' => 35,
166-
'hydra:view' => [
165+
'totalItems' => 35,
166+
'view' => [
167167
'@id' => '/books.jsonld?page=1',
168-
'@type' => 'hydra:PartialCollectionView',
169-
'hydra:first' => '/books.jsonld?page=1',
170-
'hydra:last' => '/books.jsonld?page=2',
171-
'hydra:next' => '/books.jsonld?page=2',
168+
'@type' => 'PartialCollectionView',
169+
'first' => '/books.jsonld?page=1',
170+
'last' => '/books.jsonld?page=2',
171+
'next' => '/books.jsonld?page=2',
172172
],
173173
]);
174174
}

docs/guides/doctrine-search-filter.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ public function testGetDocumentation(): void
118118
$this->assertResponseIsSuccessful();
119119
$this->assertMatchesResourceCollectionJsonSchema(Book::class, '_api_books{._format}_get_collection', 'jsonld');
120120
$this->assertJsonContains([
121-
'hydra:search' => [
122-
'@type' => 'hydra:IriTemplate',
123-
'hydra:template' => '/books.jsonld{?id,title,author}',
124-
'hydra:variableRepresentation' => 'BasicRepresentation',
125-
'hydra:mapping' => [
121+
'search' => [
122+
'@type' => 'IriTemplate',
123+
'template' => '/books.jsonld{?id,title,author}',
124+
'variableRepresentation' => 'BasicRepresentation',
125+
'mapping' => [
126126
[
127127
'@type' => 'IriTemplateMapping',
128128
'variable' => 'id',

docs/guides/how-to.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ public function testAsAnonymousICanAccessTheDocumentation(): void
137137

138138
$this->assertResponseIsSuccessful();
139139
$this->assertMatchesResourceCollectionJsonSchema(Book::class, '_api_/books{._format}_get_collection', 'jsonld');
140-
$this->assertNotSame(0, $response->toArray(false)['hydra:totalItems'], 'The collection is empty.');
140+
$this->assertNotSame(0, $response->toArray(false)['totalItems'], 'The collection is empty.');
141141
$this->assertJsonContains([
142-
'hydra:totalItems' => 10,
142+
'totalItems' => 10,
143143
]);
144144
}
145145
}

docs/guides/return-the-iri-of-your-resources-relations.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function setBrand(Brand $brand): void
157157
//
158158
// 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.
159159
//
160-
// The **Hydra** documentation will set the properties as `hydra:Link` with the right domain, with `hydra:readable` to `true` but `hydra:writable` to `false`.
160+
// The **Hydra** documentation will set the properties as `Link` with the right domain, with `readable` to `true` but `writable` to `false`.
161161
//
162162
// When using JSON:API or HAL formats, the IRI will be used and set links, embedded and relationship.
163163
//

docs/guides/test-your-api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testGetCollection(): void
3939
// matches an expected format, for example here with a collection.
4040
$this->assertMatchesResourceCollectionJsonSchema(Book::class);
4141
// PHPUnit default assertions are also available.
42-
$this->assertCount(0, $response->toArray()['hydra:member']);
42+
$this->assertCount(0, $response->toArray()['member']);
4343
}
4444
}
4545
}

docs/guides/validate-incoming-data.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ public function testValidation(): void
139139
// {
140140
// "@context": "/contexts/ConstraintViolationList",
141141
// "@type": "ConstraintViolationList",
142-
// "hydra:title": "An error occurred",
143-
// "hydra:description": "properties: The product must have the minimal properties required (\"description\", \"price\")",
142+
// "title": "An error occurred",
143+
// "description": "properties: The product must have the minimal properties required (\"description\", \"price\")",
144144
// "violations": [
145145
// {
146146
// "propertyPath": "properties",
@@ -151,7 +151,7 @@ public function testValidation(): void
151151
// ```
152152
$this->assertResponseStatusCodeSame(422);
153153
$this->assertJsonContains([
154-
'hydra:description' => 'properties: The product must have the minimal properties required ("description", "price")',
154+
'description' => 'properties: The product must have the minimal properties required ("description", "price")',
155155
'title' => 'An error occurred',
156156
'violations' => [
157157
['propertyPath' => 'properties', 'message' => 'The product must have the minimal properties required ("description", "price")'],

0 commit comments

Comments
 (0)