@@ -53,6 +53,7 @@ public function asAnonymousICanGetACollectionOfBookReviewsWithoutFilters(Factory
5353
5454 self ::assertResponseIsSuccessful ();
5555 self ::assertResponseHeaderSame ('content-type ' , 'application/ld+json; charset=utf-8 ' );
56+ self ::assertEquals ('<https://localhost/.well-known/mercure>; rel="mercure" ' , $ response ->getHeaders ()['link ' ][1 ]);
5657 self ::assertJsonContains ([
5758 'hydra:totalItems ' => $ hydraTotalItems ,
5859 ]);
@@ -266,6 +267,7 @@ public function asAUserICanAddAReviewOnABook(): void
266267
267268 self ::assertResponseStatusCodeSame (Response::HTTP_CREATED );
268269 self ::assertResponseHeaderSame ('content-type ' , 'application/ld+json; charset=utf-8 ' );
270+ self ::assertEquals ('<https://localhost/.well-known/mercure>; rel="mercure" ' , $ response ->getHeaders (false )['link ' ][1 ]);
269271 self ::assertJsonContains ([
270272 'book ' => '/books/ ' . $ book ->getId (),
271273 'user ' => [
@@ -284,7 +286,12 @@ public function asAUserICanAddAReviewOnABook(): void
284286 self ::assertCount (1 , self ::getMercureMessages ());
285287 self ::assertMercureUpdateMatchesJsonSchema (
286288 update: self ::getMercureMessage (),
287- topics: ['http://localhost/admin/reviews/ ' . $ review ->getId (), 'http://localhost/books/ ' . $ book ->getId () . '/reviews/ ' . $ review ->getId ()],
289+ topics: [
290+ 'http://localhost/admin/reviews/ ' . $ review ->getId (),
291+ 'http://localhost/admin/reviews ' ,
292+ 'http://localhost/books/ ' . $ book ->getId () . '/reviews/ ' . $ review ->getId (),
293+ 'http://localhost/books/ ' . $ book ->getId () . '/reviews ' ,
294+ ],
288295 jsonSchema: file_get_contents (__DIR__ . '/Admin/schemas/Review/item.json ' )
289296 );
290297 }
@@ -451,7 +458,7 @@ public function asAUserICanUpdateMyBookReview(): void
451458 'authorize ' => true ,
452459 ]);
453460
454- $ this ->client ->request ('PATCH ' , '/books/ ' . $ review ->book ->getId () . '/reviews/ ' . $ review ->getId (), [
461+ $ response = $ this ->client ->request ('PATCH ' , '/books/ ' . $ review ->book ->getId () . '/reviews/ ' . $ review ->getId (), [
455462 'auth_bearer ' => $ token ,
456463 'json ' => [
457464 'body ' => 'Very good book! ' ,
@@ -464,6 +471,7 @@ public function asAUserICanUpdateMyBookReview(): void
464471
465472 self ::assertResponseStatusCodeSame (Response::HTTP_OK );
466473 self ::assertResponseHeaderSame ('content-type ' , 'application/ld+json; charset=utf-8 ' );
474+ self ::assertEquals ('<https://localhost/.well-known/mercure>; rel="mercure" ' , $ response ->getHeaders (false )['link ' ][1 ]);
467475 self ::assertJsonContains ([
468476 'body ' => 'Very good book! ' ,
469477 'rating ' => 5 ,
@@ -472,7 +480,12 @@ public function asAUserICanUpdateMyBookReview(): void
472480 self ::assertCount (1 , self ::getMercureMessages ());
473481 self ::assertMercureUpdateMatchesJsonSchema (
474482 update: self ::getMercureMessage (),
475- topics: ['http://localhost/admin/reviews/ ' . $ review ->getId (), 'http://localhost/books/ ' . $ review ->book ->getId () . '/reviews/ ' . $ review ->getId ()],
483+ topics: [
484+ 'http://localhost/admin/reviews/ ' . $ review ->getId (),
485+ 'http://localhost/admin/reviews ' ,
486+ 'http://localhost/books/ ' . $ review ->book ->getId () . '/reviews/ ' . $ review ->getId (),
487+ 'http://localhost/books/ ' . $ review ->book ->getId () . '/reviews ' ,
488+ ],
476489 jsonSchema: file_get_contents (__DIR__ . '/Admin/schemas/Review/item.json ' )
477490 );
478491 }
@@ -560,7 +573,12 @@ public function asAUserICanDeleteMyBookReview(): void
560573 self ::assertCount (1 , self ::getMercureMessages ());
561574 self ::assertEquals (
562575 new Update (
563- topics: ['http://localhost/admin/reviews/ ' . $ id , 'http://localhost/books/ ' . $ bookId . '/reviews/ ' . $ id ],
576+ topics: [
577+ 'http://localhost/admin/reviews/ ' . $ id ,
578+ 'http://localhost/admin/reviews ' ,
579+ 'http://localhost/books/ ' . $ bookId . '/reviews/ ' . $ id ,
580+ 'http://localhost/books/ ' . $ bookId . '/reviews ' ,
581+ ],
564582 data: json_encode (['@id ' => '/admin/reviews/ ' . $ id , '@type ' => 'https://schema.org/Review ' ]),
565583 ),
566584 self ::getMercureMessage ()
0 commit comments