@@ -73,6 +73,21 @@ public function testAddOneCss()
7373 $ this ->assertCount (0 , $ assets );
7474 }
7575
76+ public function testPrependOneCss ()
77+ {
78+ $ this ->assertCount (0 , $ this ->manager ->getCss ());
79+
80+ $ asset1 = uniqid ('asset1 ' );
81+ $ asset2 = uniqid ('asset2 ' );
82+ $ this ->manager ->addCss ($ asset2 );
83+ $ this ->manager ->prependCss ($ asset1 );
84+
85+ $ assets = $ this ->manager ->getCss ();
86+ $ this ->assertStringEndsWith ($ asset2 , array_pop ($ assets ));
87+ $ this ->assertStringEndsWith ($ asset1 , array_pop ($ assets ));
88+ $ this ->assertCount (0 , $ assets );
89+ }
90+
7691 public function testAddOneJs ()
7792 {
7893 $ this ->assertCount (0 , $ this ->manager ->getJs ());
@@ -86,6 +101,21 @@ public function testAddOneJs()
86101 $ this ->assertCount (0 , $ assets );
87102 }
88103
104+ public function testPrependOneJs ()
105+ {
106+ $ this ->assertCount (0 , $ this ->manager ->getJs ());
107+
108+ $ asset1 = uniqid ('asset1 ' );
109+ $ asset2 = uniqid ('asset2 ' );
110+ $ this ->manager ->addJs ($ asset2 );
111+ $ this ->manager ->prependJs ($ asset1 );
112+
113+ $ assets = $ this ->manager ->getJs ();
114+ $ this ->assertStringEndsWith ($ asset2 , array_pop ($ assets ));
115+ $ this ->assertStringEndsWith ($ asset1 , array_pop ($ assets ));
116+ $ this ->assertCount (0 , $ assets );
117+ }
118+
89119 public function testAddMultipleCss ()
90120 {
91121 $ this ->assertCount (0 , $ this ->manager ->getCss ());
@@ -101,6 +131,24 @@ public function testAddMultipleCss()
101131 $ this ->assertCount (0 , $ assets );
102132 }
103133
134+ public function testPrependMultipleCss ()
135+ {
136+ $ this ->assertCount (0 , $ this ->manager ->getCss ());
137+
138+ $ asset1 = uniqid ('asset1 ' );
139+ $ asset2 = uniqid ('asset2 ' );
140+ $ asset3 = uniqid ('asset3 ' );
141+ $ this ->manager ->addCss ($ asset3 );
142+ $ this ->manager ->prependCss (array ($ asset1 , $ asset2 ));
143+ $ assets = $ this ->manager ->getCss ();
144+
145+ $ this ->assertCount (3 , $ assets );
146+ $ this ->assertStringEndsWith ($ asset3 , array_pop ($ assets ));
147+ $ this ->assertStringEndsWith ($ asset2 , array_pop ($ assets ));
148+ $ this ->assertStringEndsWith ($ asset1 , array_pop ($ assets ));
149+ $ this ->assertCount (0 , $ assets );
150+ }
151+
104152 public function testAddMultipleJs ()
105153 {
106154 $ this ->assertCount (0 , $ this ->manager ->getJs ());
@@ -116,6 +164,24 @@ public function testAddMultipleJs()
116164 $ this ->assertCount (0 , $ assets );
117165 }
118166
167+ public function testPrependMultipleJs ()
168+ {
169+ $ this ->assertCount (0 , $ this ->manager ->getJs ());
170+
171+ $ asset1 = uniqid ('asset1 ' );
172+ $ asset2 = uniqid ('asset2 ' );
173+ $ asset3 = uniqid ('asset3 ' );
174+ $ this ->manager ->addJs ($ asset3 );
175+ $ this ->manager ->prependJs (array ($ asset1 , $ asset2 ));
176+ $ assets = $ this ->manager ->getJs ();
177+
178+ $ this ->assertCount (3 , $ assets );
179+ $ this ->assertStringEndsWith ($ asset3 , array_pop ($ assets ));
180+ $ this ->assertStringEndsWith ($ asset2 , array_pop ($ assets ));
181+ $ this ->assertStringEndsWith ($ asset1 , array_pop ($ assets ));
182+ $ this ->assertCount (0 , $ assets );
183+ }
184+
119185 public function testDetectAndAddCss ()
120186 {
121187 $ this ->assertCount (0 , $ this ->manager ->getCss ());
0 commit comments