@@ -170,7 +170,9 @@ public function test_layout_group_creates_component_group_with_correct_propertie
170170 $ em = $ this ->collectingEm ($ persisted );
171171
172172 $ iriConverter = $ this ->createStub (IriConverterInterface::class);
173- $ iriConverter ->method ('getIriFromResource ' )->willReturn ('/_/some_components ' ); // any call returns the stub IRI
173+ $ iriConverter ->method ('getIriFromResource ' )->willReturnCallback (
174+ static fn ($ resource ) => is_string ($ resource ) ? '/_/some_components ' : '/_api/_/layouts/test-uuid '
175+ );
174176
175177 $ builder = $ this ->makeBuilder ($ em , iriConverter: $ iriConverter );
176178 $ builder ->layout ('main ' , 'CwaLayoutPrimary ' )->group ('nav ' , allow: [\stdClass::class]);
@@ -180,8 +182,8 @@ public function test_layout_group_creates_component_group_with_correct_propertie
180182 $ layouts = array_values (array_filter ($ persisted , static fn ($ e ) => $ e instanceof Layout));
181183
182184 $ this ->assertCount (1 , $ groups );
183- $ this ->assertSame ('layout:main/nav ' , $ groups [0 ]->reference );
184- $ this ->assertSame ('nav ' , $ groups [0 ]->location );
185+ $ this ->assertSame ('nav_/_api/_/layouts/test-uuid ' , $ groups [0 ]->reference );
186+ $ this ->assertSame ('/_api/_/layouts/test-uuid ' , $ groups [0 ]->location );
185187 $ this ->assertSame (['/_/some_components ' ], $ groups [0 ]->allowedComponents );
186188
187189 $ this ->assertCount (1 , $ layouts );
@@ -196,7 +198,10 @@ public function test_page_group_creates_component_group_linked_to_page(): void
196198 $ persisted = [];
197199 $ em = $ this ->collectingEm ($ persisted );
198200
199- $ builder = $ this ->makeBuilder ($ em );
201+ $ iriConverter = $ this ->createStub (IriConverterInterface::class);
202+ $ iriConverter ->method ('getIriFromResource ' )->willReturn ('/_api/_/pages/test-uuid ' );
203+
204+ $ builder = $ this ->makeBuilder ($ em , iriConverter: $ iriConverter );
200205 $ builder ->layout ('main ' , 'CwaLayoutPrimary ' );
201206 $ builder ->page ('home ' , 'PrimaryPageTemplate ' , layout: 'main ' , isTemplate: true )
202207 ->group ('primary ' );
@@ -206,8 +211,8 @@ public function test_page_group_creates_component_group_linked_to_page(): void
206211 $ pages = array_values (array_filter ($ persisted , static fn ($ e ) => $ e instanceof Page));
207212
208213 $ this ->assertCount (1 , $ groups );
209- $ this ->assertSame ('page:home/primary ' , $ groups [0 ]->reference );
210- $ this ->assertSame ('primary ' , $ groups [0 ]->location );
214+ $ this ->assertSame ('primary_/_api/_/pages/test-uuid ' , $ groups [0 ]->reference );
215+ $ this ->assertSame ('/_api/_/pages/test-uuid ' , $ groups [0 ]->location );
211216 $ this ->assertNull ($ groups [0 ]->allowedComponents );
212217
213218 $ this ->assertCount (1 , $ pages );
0 commit comments