44use Tatter \Assets \Bundle ;
55use Tatter \Assets \Config \Assets as AssetsConfig ;
66use Tests \Support \AssetsTestCase ;
7+ use Tests \Support \Bundles \FruitSalad ;
78
89final class BundleTest extends AssetsTestCase
910{
@@ -20,6 +21,31 @@ public function testConstructorPaths()
2021 $ this ->assertEquals (Asset::createFromPath ('apple.css ' ), $ assets [0 ]);
2122 }
2223
24+ public function testConstructorBundles ()
25+ {
26+ $ bundle = new class extends Bundle {
27+ protected $ bundles = [FruitSalad::class];
28+ };
29+
30+ $ assets = $ bundle ->getAssets ();
31+
32+ $ this ->assertCount (2 , $ assets );
33+ $ this ->assertEquals (Asset::createFromPath ('apple.css ' ), $ assets [0 ]);
34+ $ this ->assertEquals (Asset::createFromPath ('banana.js ' ), $ assets [1 ]);
35+ }
36+ public function testConstructorStrings ()
37+ {
38+ $ bundle = new class extends Bundle {
39+ protected $ strings = ['foobar ' ];
40+ };
41+
42+ $ assets = $ bundle ->getAssets ();
43+
44+ $ this ->assertCount (1 , $ assets );
45+ $ this ->assertInstanceOf (Asset::class, $ assets [0 ]);
46+ $ this ->assertSame ('foobar ' , (string ) $ assets [0 ]);
47+ }
48+
2349 public function testStringable ()
2450 {
2551 $ asset = new class extends Bundle {
0 commit comments