@@ -53,6 +53,7 @@ public function asAnonymousICanGetACollectionOfBookReviewsWithoutFilters(Factory
53
53
54
54
self ::assertResponseIsSuccessful ();
55
55
self ::assertResponseHeaderSame ('content-type ' , 'application/ld+json; charset=utf-8 ' );
56
+ self ::assertEquals ('<https://localhost/.well-known/mercure>; rel="mercure" ' , $ response ->getHeaders ()['link ' ][1 ]);
56
57
self ::assertJsonContains ([
57
58
'hydra:totalItems ' => $ hydraTotalItems ,
58
59
]);
@@ -266,6 +267,7 @@ public function asAUserICanAddAReviewOnABook(): void
266
267
267
268
self ::assertResponseStatusCodeSame (Response::HTTP_CREATED );
268
269
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 ]);
269
271
self ::assertJsonContains ([
270
272
'book ' => '/books/ ' . $ book ->getId (),
271
273
'user ' => [
@@ -284,7 +286,12 @@ public function asAUserICanAddAReviewOnABook(): void
284
286
self ::assertCount (1 , self ::getMercureMessages ());
285
287
self ::assertMercureUpdateMatchesJsonSchema (
286
288
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
+ ],
288
295
jsonSchema: file_get_contents (__DIR__ . '/Admin/schemas/Review/item.json ' )
289
296
);
290
297
}
@@ -451,7 +458,7 @@ public function asAUserICanUpdateMyBookReview(): void
451
458
'authorize ' => true ,
452
459
]);
453
460
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 (), [
455
462
'auth_bearer ' => $ token ,
456
463
'json ' => [
457
464
'body ' => 'Very good book! ' ,
@@ -464,6 +471,7 @@ public function asAUserICanUpdateMyBookReview(): void
464
471
465
472
self ::assertResponseStatusCodeSame (Response::HTTP_OK );
466
473
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 ]);
467
475
self ::assertJsonContains ([
468
476
'body ' => 'Very good book! ' ,
469
477
'rating ' => 5 ,
@@ -472,7 +480,12 @@ public function asAUserICanUpdateMyBookReview(): void
472
480
self ::assertCount (1 , self ::getMercureMessages ());
473
481
self ::assertMercureUpdateMatchesJsonSchema (
474
482
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
+ ],
476
489
jsonSchema: file_get_contents (__DIR__ . '/Admin/schemas/Review/item.json ' )
477
490
);
478
491
}
@@ -560,7 +573,12 @@ public function asAUserICanDeleteMyBookReview(): void
560
573
self ::assertCount (1 , self ::getMercureMessages ());
561
574
self ::assertEquals (
562
575
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
+ ],
564
582
data: json_encode (['@id ' => '/admin/reviews/ ' . $ id , '@type ' => 'https://schema.org/Review ' ]),
565
583
),
566
584
self ::getMercureMessage ()
0 commit comments