5
5
namespace App \Tests \State \Processor ;
6
6
7
7
use ApiPlatform \Api \IriConverterInterface ;
8
- use ApiPlatform \Api \UrlGeneratorInterface ;
9
8
use ApiPlatform \Metadata \ApiResource ;
10
9
use ApiPlatform \Metadata \Get ;
11
10
use ApiPlatform \Metadata \Operation ;
@@ -63,8 +62,9 @@ public function itSendsAMercureUpdate(): void
63
62
$ this ->iriConverterMock
64
63
->expects ($ this ->once ())
65
64
->method ('getIriFromResource ' )
66
- ->with ($ this ->objectMock , UrlGeneratorInterface::ABS_URL , $ this ->operationMock )
67
- ->willReturn ('/books/9aff4b91-31cf-4e91-94b0-1d52bbe23fe6 ' )
65
+ ->willReturnOnConsecutiveCalls (
66
+ 'https://example.com/books/9aff4b91-31cf-4e91-94b0-1d52bbe23fe6 ' ,
67
+ )
68
68
;
69
69
$ this ->operationMock
70
70
->expects ($ this ->once ())
@@ -81,7 +81,7 @@ public function itSendsAMercureUpdate(): void
81
81
->expects ($ this ->once ())
82
82
->method ('publish ' )
83
83
->with ($ this ->equalTo (new Update (
84
- topics: ['/books/9aff4b91-31cf-4e91-94b0-1d52bbe23fe6 ' ],
84
+ topics: ['https://example.com /books/9aff4b91-31cf-4e91-94b0-1d52bbe23fe6 ' ],
85
85
data: json_encode (['foo ' => 'bar ' ]),
86
86
)))
87
87
;
@@ -105,14 +105,14 @@ public function itSendsAMercureUpdateWithContextOptions(): void
105
105
->expects ($ this ->once ())
106
106
->method ('publish ' )
107
107
->with ($ this ->equalTo (new Update (
108
- topics: ['/admin/books/9aff4b91-31cf-4e91-94b0-1d52bbe23fe6 ' ],
108
+ topics: ['https://example.com /admin/books/9aff4b91-31cf-4e91-94b0-1d52bbe23fe6 ' ],
109
109
data: json_encode (['bar ' => 'baz ' ]),
110
110
)))
111
111
;
112
112
113
113
$ this ->processor ->process ($ this ->objectMock , $ this ->operationMock , [], [
114
114
'item_uri_template ' => '/admin/books/{id}{._format} ' ,
115
- 'topics ' => ['/admin/books/9aff4b91-31cf-4e91-94b0-1d52bbe23fe6 ' ],
115
+ 'topics ' => ['https://example.com /admin/books/9aff4b91-31cf-4e91-94b0-1d52bbe23fe6 ' ],
116
116
MercureProcessor::DATA => json_encode (['bar ' => 'baz ' ]),
117
117
]);
118
118
}
0 commit comments