@@ -75,6 +75,7 @@ public function asAdminUserICanGetACollectionOfBooks(FactoryCollection $factory,
75
75
76
76
self ::assertResponseIsSuccessful ();
77
77
self ::assertResponseHeaderSame ('content-type ' , 'application/ld+json; charset=utf-8 ' );
78
+ self ::assertEquals ('<https://localhost/.well-known/mercure>; rel="mercure" ' , $ response ->getHeaders ()['link ' ][1 ]);
78
79
self ::assertJsonContains ([
79
80
'hydra:totalItems ' => $ hydraTotalItems ,
80
81
]);
@@ -142,6 +143,7 @@ public function asAdminUserICanGetACollectionOfBooksOrderedByTitle(): void
142
143
143
144
self ::assertResponseIsSuccessful ();
144
145
self ::assertResponseHeaderSame ('content-type ' , 'application/ld+json; charset=utf-8 ' );
146
+ self ::assertEquals ('<https://localhost/.well-known/mercure>; rel="mercure" ' , $ response ->getHeaders ()['link ' ][1 ]);
145
147
self ::assertEquals ('Ball Lightning ' , $ response ->toArray ()['hydra:member ' ][0 ]['title ' ]);
146
148
self ::assertEquals ('Hyperion ' , $ response ->toArray ()['hydra:member ' ][1 ]['title ' ]);
147
149
self ::assertEquals ('The Wandering Earth ' , $ response ->toArray ()['hydra:member ' ][2 ]['title ' ]);
@@ -210,10 +212,11 @@ public function asAdminUserICanGetABook(): void
210
212
'email ' => UserFactory::createOneAdmin ()->email ,
211
213
]);
212
214
213
- $ this ->client ->request ('GET ' , '/admin/books/ ' . $ book ->getId (), ['auth_bearer ' => $ token ]);
215
+ $ response = $ this ->client ->request ('GET ' , '/admin/books/ ' . $ book ->getId (), ['auth_bearer ' => $ token ]);
214
216
215
217
self ::assertResponseIsSuccessful ();
216
218
self ::assertResponseHeaderSame ('content-type ' , 'application/ld+json; charset=utf-8 ' );
219
+ self ::assertEquals ('<https://localhost/.well-known/mercure>; rel="mercure" ' , $ response ->getHeaders (false )['link ' ][1 ]);
217
220
self ::assertJsonContains ([
218
221
'@id ' => '/admin/books/ ' . $ book ->getId (),
219
222
'book ' => $ book ->book ,
@@ -385,6 +388,7 @@ public function asAdminUserICanCreateABook(): void
385
388
386
389
self ::assertResponseStatusCodeSame (Response::HTTP_CREATED );
387
390
self ::assertResponseHeaderSame ('content-type ' , 'application/ld+json; charset=utf-8 ' );
391
+ self ::assertEquals ('<https://localhost/.well-known/mercure>; rel="mercure" ' , $ response ->getHeaders (false )['link ' ][1 ]);
388
392
self ::assertJsonContains ([
389
393
'book ' => 'https://openlibrary.org/books/OL28346544M.json ' ,
390
394
'condition ' => BookCondition::NewCondition->value ,
@@ -508,7 +512,7 @@ public function asAdminUserICanUpdateABook(): void
508
512
'email ' => UserFactory::createOneAdmin ()->email ,
509
513
]);
510
514
511
- $ this ->client ->request ('PUT ' , '/admin/books/ ' . $ book ->getId (), [
515
+ $ response = $ this ->client ->request ('PUT ' , '/admin/books/ ' . $ book ->getId (), [
512
516
'auth_bearer ' => $ token ,
513
517
'json ' => [
514
518
'@id ' => '/books/ ' . $ book ->getId (),
@@ -524,6 +528,7 @@ public function asAdminUserICanUpdateABook(): void
524
528
525
529
self ::assertResponseStatusCodeSame (Response::HTTP_OK );
526
530
self ::assertResponseHeaderSame ('content-type ' , 'application/ld+json; charset=utf-8 ' );
531
+ self ::assertEquals ('<https://localhost/.well-known/mercure>; rel="mercure" ' , $ response ->getHeaders (false )['link ' ][1 ]);
527
532
self ::assertJsonContains ([
528
533
'book ' => 'https://openlibrary.org/books/OL28346544M.json ' ,
529
534
'condition ' => BookCondition::DamagedCondition->value ,
0 commit comments