@@ -53,7 +53,7 @@ public function testBundleWithoutFilesWiringOrDependenciesRendersABodylessCard()
5353 );
5454
5555 self ::assertSame (
56- 'app \\ assets \\ -empty-asset ' ,
56+ 'app- assets-emptyasset-e3777dff ' ,
5757 $ card ->id ,
5858 'Anchor must survive an empty capture. ' ,
5959 );
@@ -125,7 +125,7 @@ public function testEmptyCaptureDeactivatesThePanelAndExplainsTheMissingBundles(
125125 );
126126 }
127127
128- public function testGlobalNamespaceBundleDropsTheSubtitleAndKeepsItsBareAnchor (): void
128+ public function testGlobalNamespaceBundleDropsTheSubtitleAndAnchorsOnItsBareClassName (): void
129129 {
130130 $ card = self ::card (
131131 self ::blockAt (
@@ -135,9 +135,9 @@ public function testGlobalNamespaceBundleDropsTheSubtitleAndKeepsItsBareAnchor()
135135 );
136136
137137 self ::assertSame (
138- 'global-asset ' ,
138+ 'globalasset-762af4c5 ' ,
139139 $ card ->id ,
140- 'Anchor must drop to the bare class name. ' ,
140+ 'Anchor must slug the class name alone . ' ,
141141 );
142142 self ::assertSame (
143143 'GlobalAsset ' ,
@@ -179,12 +179,23 @@ public function testRegisteredBundlesProduceTheirCardsWithFilesAndWiringColumns(
179179 self ::bundle (['depends ' => ['yii \\web \\YiiAsset ' , 'yii \\web \\JqueryAsset ' ]]),
180180 self ::bundle (
181181 [
182- 'name ' => 'app \\ assets \\ SecondAsset ' ,
182+ 'name ' => 'yii \\ web \\ YiiAsset ' ,
183183 'sourcePath ' => '' ,
184184 'basePath ' => '' ,
185185 'baseUrl ' => '' ,
186186 'css ' => [],
187- 'js ' => ['second.js ' ],
187+ 'js ' => ['yii.js ' ],
188+ 'depends ' => [],
189+ ],
190+ ),
191+ self ::bundle (
192+ [
193+ 'name ' => 'yii \\web \\JqueryAsset ' ,
194+ 'sourcePath ' => '' ,
195+ 'basePath ' => '' ,
196+ 'baseUrl ' => '' ,
197+ 'css ' => [],
198+ 'js ' => ['jquery.js ' ],
188199 'depends ' => [],
189200 ],
190201 ),
@@ -197,24 +208,24 @@ public function testRegisteredBundlesProduceTheirCardsWithFilesAndWiringColumns(
197208 );
198209 self ::assertEquals (
199210 [
200- new StatEntry ('asset ' , 'bundles ' , '2 ' , Tone::MUTED ),
211+ new StatEntry ('asset ' , 'bundles ' , '3 ' , Tone::MUTED ),
201212 new StatEntry ('brand-css3 ' , 'css ' , '1 ' , Tone::INFO ),
202- new StatEntry ('brand-javascript ' , 'js ' , '3 ' , Tone::WARNING ),
213+ new StatEntry ('brand-javascript ' , 'js ' , '4 ' , Tone::WARNING ),
203214 new StatEntry ('link ' , 'links ' , '2 ' , Tone::SUCCESS ),
204215 ],
205216 self ::stats (self ::blockAt ($ view , 0 ))->stats ,
206217 'The aggregate tiles must total every bundle. ' ,
207218 );
208219 self ::assertEquals (
209- [new ToolbarMetric ('Bundles ' , '2 ' )],
220+ [new ToolbarMetric ('Bundles ' , '3 ' )],
210221 $ view ->toolbarMetrics (),
211222 'The toolbar must report the bundle count. ' ,
212223 );
213224
214225 $ card = self ::card (self ::blockAt ($ view , 1 ));
215226
216227 self ::assertSame (
217- 'app \\ assets \\ -app-asset ' ,
228+ 'app- assets-appasset-3c6a8113 ' ,
218229 $ card ->id ,
219230 'Anchor must derive from the bundle class. ' ,
220231 );
@@ -288,30 +299,36 @@ public function testRegisteredBundlesProduceTheirCardsWithFilesAndWiringColumns(
288299 $ depends ->label ,
289300 'The strip must count what it lists. ' ,
290301 );
302+
303+ $ yii = self ::card (self ::blockAt ($ view , 2 ));
304+ $ jquery = self ::card (self ::blockAt ($ view , 3 ));
305+
306+ self ::assertSame (
307+ ['yii-web-yiiasset-7afeb318 ' , 'yii-web-jqueryasset-2772d8b9 ' ],
308+ [$ yii ->id , $ jquery ->id ],
309+ 'Every dependency must own a URL-safe card anchor. ' ,
310+ );
291311 self ::assertEquals (
292312 [
293- new LinkInline ('YiiAsset ' , ' # yii\\ web \\ -yii-asset ' , false ),
294- new LinkInline ('JqueryAsset ' , ' #yii \\ web \\ - jquery-asset ' , false ),
313+ new LinkInline ('YiiAsset ' , " # { $ yii-> id }" , false ),
314+ new LinkInline ('JqueryAsset ' , " # { $ jquery -> id }" , false ),
295315 ],
296316 $ depends ->links ,
297317 'Each dependency must point at the anchor of its own card. ' ,
298318 );
299-
300- $ second = self ::card (self ::blockAt ($ view , 2 ));
301-
302319 self ::assertEquals (
303320 [new BadgeInline ('1 js ' , Tone::WARNING )],
304- $ second ->meta ,
321+ $ yii ->meta ,
305322 'An absent kind must leave no chip behind. ' ,
306323 );
307324 self ::assertCount (
308325 1 ,
309- $ second ->columns ,
326+ $ yii ->columns ,
310327 'A bundle that publishes nothing must keep only its files. ' ,
311328 );
312329 self ::assertEquals (
313- [new FileEntry ('.js ' , 'second .js ' , Tone::WARNING )],
314- self ::files (self ::columnBlockAt (self ::column ($ second , 0 ), 0 ))->files ,
330+ [new FileEntry ('.js ' , 'yii .js ' , Tone::WARNING )],
331+ self ::files (self ::columnBlockAt (self ::column ($ yii , 0 ), 0 ))->files ,
315332 'Scripts alone must still fill the first list. ' ,
316333 );
317334 }
0 commit comments