AssetsTest.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. <?php
  2. use Codeception\Util\Fixtures;
  3. use Grav\Common\Grav;
  4. use Grav\Common\Assets;
  5. /**
  6. * Class AssetsTest
  7. */
  8. class AssetsTest extends \Codeception\TestCase\Test
  9. {
  10. /** @var Grav $grav */
  11. protected $grav;
  12. /** @var Assets $assets */
  13. protected $assets;
  14. protected function _before()
  15. {
  16. $grav = Fixtures::get('grav');
  17. $this->grav = $grav();
  18. $this->assets = $this->grav['assets'];
  19. }
  20. protected function _after()
  21. {
  22. }
  23. public function testAddingAssets()
  24. {
  25. //test add()
  26. $this->assets->add('test.css');
  27. $css = $this->assets->css();
  28. $this->assertSame('<link href="/test.css" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  29. $array = $this->assets->getCss();
  30. $this->assertSame([
  31. 'asset' => '/test.css',
  32. 'remote' => false,
  33. 'priority' => 10,
  34. 'order' => 0,
  35. 'pipeline' => true,
  36. 'loading' => '',
  37. 'group' => 'head',
  38. 'modified' => false,
  39. 'query' => ''
  40. ], reset($array));
  41. $this->assets->add('test.js');
  42. $js = $this->assets->js();
  43. $this->assertSame('<script src="/test.js" ></script>' . PHP_EOL, $js);
  44. $array = $this->assets->getCss();
  45. $this->assertSame([
  46. 'asset' => '/test.css',
  47. 'remote' => false,
  48. 'priority' => 10,
  49. 'order' => 0,
  50. 'pipeline' => true,
  51. 'loading' => '',
  52. 'group' => 'head',
  53. 'modified' => false,
  54. 'query' => ''
  55. ], reset($array));
  56. //test addCss(). Test adding asset to a separate group
  57. $this->assets->reset();
  58. $this->assets->addCSS('test.css');
  59. $css = $this->assets->css();
  60. $this->assertSame('<link href="/test.css" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  61. $array = $this->assets->getCss();
  62. $this->assertSame([
  63. 'asset' => '/test.css',
  64. 'remote' => false,
  65. 'priority' => 10,
  66. 'order' => 0,
  67. 'pipeline' => true,
  68. 'loading' => '',
  69. 'group' => 'head',
  70. 'modified' => false,
  71. 'query' => ''
  72. ], reset($array));
  73. //test addCss(). Testing with remote URL
  74. $this->assets->reset();
  75. $this->assets->addCSS('http://www.somesite.com/test.css');
  76. $css = $this->assets->css();
  77. $this->assertSame('<link href="http://www.somesite.com/test.css" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  78. $array = $this->assets->getCss();
  79. $this->assertSame([
  80. 'asset' => 'http://www.somesite.com/test.css',
  81. 'remote' => true,
  82. 'priority' => 10,
  83. 'order' => 0,
  84. 'pipeline' => true,
  85. 'loading' => '',
  86. 'group' => 'head',
  87. 'modified' => false,
  88. 'query' => ''
  89. ], reset($array));
  90. //test addCss() adding asset to a separate group, and with an alternate rel attribute
  91. $this->assets->reset();
  92. $this->assets->addCSS('test.css', ['group' => 'alternate']);
  93. $css = $this->assets->css('alternate', ['rel' => 'alternate']);
  94. $this->assertSame('<link href="/test.css" type="text/css" rel="alternate" />' . PHP_EOL, $css);
  95. //test addJs()
  96. $this->assets->reset();
  97. $this->assets->addJs('test.js');
  98. $js = $this->assets->js();
  99. $this->assertSame('<script src="/test.js" ></script>' . PHP_EOL, $js);
  100. $array = $this->assets->getJs();
  101. $this->assertSame([
  102. 'asset' => '/test.js',
  103. 'remote' => false,
  104. 'priority' => 10,
  105. 'order' => 0,
  106. 'pipeline' => true,
  107. 'loading' => '',
  108. 'group' => 'head',
  109. 'modified' => false,
  110. 'query' => ''
  111. ], reset($array));
  112. //Test CSS Groups
  113. $this->assets->reset();
  114. $this->assets->addCSS('test.css', null, true, 'footer');
  115. $css = $this->assets->css();
  116. $this->assertEmpty($css);
  117. $css = $this->assets->css('footer');
  118. $this->assertSame('<link href="/test.css" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  119. $array = $this->assets->getCss();
  120. $this->assertSame([
  121. 'asset' => '/test.css',
  122. 'remote' => false,
  123. 'priority' => 10,
  124. 'order' => 0,
  125. 'pipeline' => true,
  126. 'loading' => '',
  127. 'group' => 'footer',
  128. 'modified' => false,
  129. 'query' => ''
  130. ], reset($array));
  131. //Test JS Groups
  132. $this->assets->reset();
  133. $this->assets->addJs('test.js', null, true, null, 'footer');
  134. $js = $this->assets->js();
  135. $this->assertEmpty($js);
  136. $js = $this->assets->js('footer');
  137. $this->assertSame('<script src="/test.js" ></script>' . PHP_EOL, $js);
  138. $array = $this->assets->getJs();
  139. $this->assertSame([
  140. 'asset' => '/test.js',
  141. 'remote' => false,
  142. 'priority' => 10,
  143. 'order' => 0,
  144. 'pipeline' => true,
  145. 'loading' => '',
  146. 'group' => 'footer',
  147. 'modified' => false,
  148. 'query' => ''
  149. ], reset($array));
  150. //Test async / defer
  151. $this->assets->reset();
  152. $this->assets->addJs('test.js', null, true, 'async', null);
  153. $js = $this->assets->js();
  154. $this->assertSame('<script src="/test.js" async></script>' . PHP_EOL, $js);
  155. $array = $this->assets->getJs();
  156. $this->assertSame([
  157. 'asset' => '/test.js',
  158. 'remote' => false,
  159. 'priority' => 10,
  160. 'order' => 0,
  161. 'pipeline' => true,
  162. 'loading' => 'async',
  163. 'group' => 'head',
  164. 'modified' => false,
  165. 'query' => ''
  166. ], reset($array));
  167. $this->assets->reset();
  168. $this->assets->addJs('test.js', null, true, 'defer', null);
  169. $js = $this->assets->js();
  170. $this->assertSame('<script src="/test.js" defer></script>' . PHP_EOL, $js);
  171. $array = $this->assets->getJs();
  172. $this->assertSame([
  173. 'asset' => '/test.js',
  174. 'remote' => false,
  175. 'priority' => 10,
  176. 'order' => 0,
  177. 'pipeline' => true,
  178. 'loading' => 'defer',
  179. 'group' => 'head',
  180. 'modified' => false,
  181. 'query' => ''
  182. ], reset($array));
  183. //Test inline
  184. $this->assets->reset();
  185. $this->assets->addJs('/system/assets/jquery/jquery-2.x.min.js', null, true, 'inline', null);
  186. $js = $this->assets->js();
  187. $this->assertContains('jQuery Foundation', $js);
  188. $this->assets->reset();
  189. $this->assets->addCss('/system/assets/debugger.css', null, true, null, 'inline');
  190. $css = $this->assets->css();
  191. $this->assertContains('div.phpdebugbar', $css);
  192. $this->assets->reset();
  193. $this->assets->addCss('https://fonts.googleapis.com/css?family=Roboto', null, true, null, 'inline');
  194. $css = $this->assets->css();
  195. $this->assertContains('font-family: \'Roboto\';', $css);
  196. //Test adding media queries
  197. $this->assets->reset();
  198. $this->assets->add('test.css', ['media' => 'only screen and (min-width: 640px)']);
  199. $css = $this->assets->css();
  200. $this->assertSame('<link href="/test.css" type="text/css" rel="stylesheet" media="only screen and (min-width: 640px)" />' . PHP_EOL, $css);
  201. }
  202. public function testAddingAssetPropertiesWithArray()
  203. {
  204. //Test adding assets with object to define properties
  205. $this->assets->reset();
  206. $this->assets->addJs('test.js', ['loading' => 'async']);
  207. $js = $this->assets->js();
  208. $this->assertSame('<script src="/test.js" async></script>' . PHP_EOL, $js);
  209. $this->assets->reset();
  210. }
  211. public function testAddingJSAssetPropertiesWithArrayFromCollection()
  212. {
  213. //Test adding properties with array
  214. $this->assets->reset();
  215. $this->assets->addJs('jquery', ['loading' => 'async']);
  216. $js = $this->assets->js();
  217. $this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" async></script>' . PHP_EOL, $js);
  218. //Test priority too
  219. $this->assets->reset();
  220. $this->assets->addJs('jquery', ['loading' => 'async', 'priority' => 1]);
  221. $this->assets->addJs('test.js', ['loading' => 'async', 'priority' => 2]);
  222. $js = $this->assets->js();
  223. $this->assertSame('<script src="/test.js" async></script>' . PHP_EOL .
  224. '<script src="/system/assets/jquery/jquery-2.x.min.js" async></script>' . PHP_EOL, $js);
  225. //Test multiple groups
  226. $this->assets->reset();
  227. $this->assets->addJs('jquery', ['loading' => 'async', 'priority' => 1, 'group' => 'footer']);
  228. $this->assets->addJs('test.js', ['loading' => 'async', 'priority' => 2]);
  229. $js = $this->assets->js();
  230. $this->assertSame('<script src="/test.js" async></script>' . PHP_EOL, $js);
  231. $js = $this->assets->js('footer');
  232. $this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" async></script>' . PHP_EOL, $js);
  233. //Test adding array of assets
  234. //Test priority too
  235. $this->assets->reset();
  236. $this->assets->addJs(['jquery', 'test.js'], ['loading' => 'async']);
  237. $js = $this->assets->js();
  238. $this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" async></script>' . PHP_EOL .
  239. '<script src="/test.js" async></script>' . PHP_EOL, $js);
  240. }
  241. public function testAddingCSSAssetPropertiesWithArrayFromCollection()
  242. {
  243. $this->assets->registerCollection('test', ['/system/assets/whoops.css']);
  244. //Test priority too
  245. $this->assets->reset();
  246. $this->assets->addCss('test', ['priority' => 1]);
  247. $this->assets->addCss('test.css', ['priority' => 2]);
  248. $css = $this->assets->css();
  249. $this->assertSame('<link href="/test.css" type="text/css" rel="stylesheet" />' . PHP_EOL .
  250. '<link href="/system/assets/whoops.css" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  251. //Test multiple groups
  252. $this->assets->reset();
  253. $this->assets->addCss('test', ['priority' => 1, 'group' => 'footer']);
  254. $this->assets->addCss('test.css', ['priority' => 2]);
  255. $css = $this->assets->css();
  256. $this->assertSame('<link href="/test.css" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  257. $css = $this->assets->css('footer');
  258. $this->assertSame('<link href="/system/assets/whoops.css" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  259. //Test adding array of assets
  260. //Test priority too
  261. $this->assets->reset();
  262. $this->assets->addCss(['test', 'test.css'], ['loading' => 'async']);
  263. $css = $this->assets->css();
  264. $this->assertSame('<link href="/system/assets/whoops.css" type="text/css" rel="stylesheet" />' . PHP_EOL .
  265. '<link href="/test.css" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  266. }
  267. public function testPriorityOfAssets()
  268. {
  269. $this->assets->reset();
  270. $this->assets->add('test.css');
  271. $this->assets->add('test-after.css');
  272. $css = $this->assets->css();
  273. $this->assertSame('<link href="/test.css" type="text/css" rel="stylesheet" />' . PHP_EOL .
  274. '<link href="/test-after.css" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  275. //----------------
  276. $this->assets->reset();
  277. $this->assets->add('test-after.css', 1);
  278. $this->assets->add('test.css', 2);
  279. $css = $this->assets->css();
  280. $this->assertSame('<link href="/test.css" type="text/css" rel="stylesheet" />' . PHP_EOL .
  281. '<link href="/test-after.css" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  282. //----------------
  283. $this->assets->reset();
  284. $this->assets->add('test-after.css', 1);
  285. $this->assets->add('test.css', 2);
  286. $this->assets->add('test-before.css', 3);
  287. $css = $this->assets->css();
  288. $this->assertSame('<link href="/test-before.css" type="text/css" rel="stylesheet" />' . PHP_EOL .
  289. '<link href="/test.css" type="text/css" rel="stylesheet" />' . PHP_EOL .
  290. '<link href="/test-after.css" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  291. }
  292. public function testPipeline()
  293. {
  294. $this->assets->reset();
  295. //File not existing. Pipeline searches for that file without reaching it. Output is empty.
  296. $this->assets->add('test.css', null, true);
  297. $this->assets->setCssPipeline(true);
  298. $css = $this->assets->css();
  299. $this->assertSame('', $css);
  300. //Add a core Grav CSS file, which is found. Pipeline will now return a file
  301. $this->assets->add('/system/assets/debugger.css', null, true);
  302. $css = $this->assets->css();
  303. $this->assertContains('<link href=', $css);
  304. $this->assertContains('type="text/css" rel="stylesheet" />', $css);
  305. }
  306. public function testPipelineWithTimestamp()
  307. {
  308. $this->assets->reset();
  309. $this->assets->setTimestamp('foo');
  310. //Add a core Grav CSS file, which is found. Pipeline will now return a file
  311. $this->assets->add('/system/assets/debugger.css', null, true);
  312. $css = $this->assets->css();
  313. $this->assertContains('<link href=', $css);
  314. $this->assertContains('type="text/css" rel="stylesheet" />', $css);
  315. $this->assertContains($this->assets->getTimestamp(), $css);
  316. }
  317. public function testInlinePipeline()
  318. {
  319. $this->assets->reset();
  320. //File not existing. Pipeline searches for that file without reaching it. Output is empty.
  321. $this->assets->add('test.css', null, true);
  322. $this->assets->setCssPipeline(true);
  323. $css = $this->assets->css('head', ['loading' => 'inline']);
  324. $this->assertSame('', $css);
  325. //Add a core Grav CSS file, which is found. Pipeline will now return its content.
  326. $this->assets->addCss('https://fonts.googleapis.com/css?family=Roboto', null, true);
  327. $this->assets->add('/system/assets/debugger.css', null, true);
  328. $css = $this->assets->css('head', ['loading' => 'inline']);
  329. $this->assertContains('font-family:\'Roboto\';', $css);
  330. $this->assertContains('div.phpdebugbar', $css);
  331. }
  332. public function testAddAsyncJs()
  333. {
  334. $this->assets->reset();
  335. $this->assets->addAsyncJs('jquery');
  336. $js = $this->assets->js();
  337. $this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" async></script>' . PHP_EOL, $js);
  338. }
  339. public function testAddDeferJs()
  340. {
  341. $this->assets->reset();
  342. $this->assets->addDeferJs('jquery');
  343. $js = $this->assets->js();
  344. $this->assertSame('<script src="/system/assets/jquery/jquery-2.x.min.js" defer></script>' . PHP_EOL, $js);
  345. }
  346. public function testTimestamps()
  347. {
  348. // local CSS nothing extra
  349. $this->assets->reset();
  350. $this->assets->setTimestamp('foo');
  351. $this->assets->addCSS('test.css');
  352. $css = $this->assets->css();
  353. $this->assertSame('<link href="/test.css?foo" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  354. // local CSS already with param
  355. $this->assets->reset();
  356. $this->assets->setTimestamp('foo');
  357. $this->assets->addCSS('test.css?bar');
  358. $css = $this->assets->css();
  359. $this->assertSame('<link href="/test.css?bar&foo" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  360. // external CSS already
  361. $this->assets->reset();
  362. $this->assets->setTimestamp('foo');
  363. $this->assets->addCSS('http://somesite.com/test.css');
  364. $css = $this->assets->css();
  365. $this->assertSame('<link href="http://somesite.com/test.css?foo" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  366. // external CSS already with param
  367. $this->assets->reset();
  368. $this->assets->setTimestamp('foo');
  369. $this->assets->addCSS('http://somesite.com/test.css?bar');
  370. $css = $this->assets->css();
  371. $this->assertSame('<link href="http://somesite.com/test.css?bar&foo" type="text/css" rel="stylesheet" />' . PHP_EOL, $css);
  372. // local JS nothing extra
  373. $this->assets->reset();
  374. $this->assets->setTimestamp('foo');
  375. $this->assets->addJs('test.js');
  376. $css = $this->assets->js();
  377. $this->assertSame('<script src="/test.js?foo" ></script>' . PHP_EOL, $css);
  378. // local JS already with param
  379. $this->assets->reset();
  380. $this->assets->setTimestamp('foo');
  381. $this->assets->addJs('test.js?bar');
  382. $css = $this->assets->js();
  383. $this->assertSame('<script src="/test.js?bar&foo" ></script>' . PHP_EOL, $css);
  384. // external JS already
  385. $this->assets->reset();
  386. $this->assets->setTimestamp('foo');
  387. $this->assets->addJs('http://somesite.com/test.js');
  388. $css = $this->assets->js();
  389. $this->assertSame('<script src="http://somesite.com/test.js?foo" ></script>' . PHP_EOL, $css);
  390. // external JS already with param
  391. $this->assets->reset();
  392. $this->assets->setTimestamp('foo');
  393. $this->assets->addJs('http://somesite.com/test.js?bar');
  394. $css = $this->assets->js();
  395. $this->assertSame('<script src="http://somesite.com/test.js?bar&foo" ></script>' . PHP_EOL, $css);
  396. }
  397. public function testAddInlineCss()
  398. {
  399. $this->assets->reset();
  400. $this->assets->addInlineCss('body { color: black }');
  401. $css = $this->assets->css();
  402. $this->assertSame(PHP_EOL . '<style>' . PHP_EOL . 'body { color: black }' . PHP_EOL . PHP_EOL . '</style>' . PHP_EOL, $css);
  403. }
  404. public function testAddInlineJs()
  405. {
  406. $this->assets->reset();
  407. $this->assets->addInlineJs('alert("test")');
  408. $js = $this->assets->js();
  409. $this->assertSame(PHP_EOL . '<script>' . PHP_EOL . 'alert("test")' . PHP_EOL . PHP_EOL . '</script>' . PHP_EOL, $js);
  410. }
  411. public function testGetCollections()
  412. {
  413. $this->assertInternalType('array', $this->assets->getCollections());
  414. $this->assertContains('jquery', array_keys($this->assets->getCollections()));
  415. $this->assertContains('system://assets/jquery/jquery-2.x.min.js', $this->assets->getCollections());
  416. }
  417. public function testExists()
  418. {
  419. $this->assertTrue($this->assets->exists('jquery'));
  420. $this->assertFalse($this->assets->exists('another-unexisting-library'));
  421. }
  422. public function testRegisterCollection()
  423. {
  424. $this->assets->registerCollection('debugger', ['/system/assets/debugger.css']);
  425. $this->assertTrue($this->assets->exists('debugger'));
  426. $this->assertContains('debugger', array_keys($this->assets->getCollections()));
  427. }
  428. public function testReset()
  429. {
  430. $this->assets->addInlineJs('alert("test")');
  431. $this->assets->reset();
  432. $this->assertCount(0, (array) $this->assets->js());
  433. $this->assets->addAsyncJs('jquery');
  434. $this->assets->reset();
  435. $this->assertCount(0, (array) $this->assets->js());
  436. $this->assets->addInlineCss('body { color: black }');
  437. $this->assets->reset();
  438. $this->assertCount(0, (array) $this->assets->css());
  439. $this->assets->add('/system/assets/debugger.css', null, true);
  440. $this->assets->reset();
  441. $this->assertCount(0, (array) $this->assets->css());
  442. }
  443. public function testResetJs()
  444. {
  445. $this->assets->addInlineJs('alert("test")');
  446. $this->assets->resetJs();
  447. $this->assertCount(0, (array) $this->assets->js());
  448. $this->assets->addAsyncJs('jquery');
  449. $this->assets->resetJs();
  450. $this->assertCount(0, (array) $this->assets->js());
  451. }
  452. public function testResetCss()
  453. {
  454. $this->assertCount(0, (array) $this->assets->js());
  455. $this->assets->addInlineCss('body { color: black }');
  456. $this->assets->resetCss();
  457. $this->assertCount(0, (array) $this->assets->css());
  458. $this->assets->add('/system/assets/debugger.css', null, true);
  459. $this->assets->resetCss();
  460. $this->assertCount(0, (array) $this->assets->css());
  461. }
  462. public function testAddDirCss()
  463. {
  464. $this->assets->addDirCss('/system');
  465. $this->assertInternalType('array', $this->assets->getCss());
  466. $this->assertGreaterThan(0, (array) $this->assets->getCss());
  467. $this->assertInternalType('array', $this->assets->getJs());
  468. $this->assertCount(0, (array) $this->assets->getJs());
  469. $this->assets->reset();
  470. $this->assets->addDirCss('/system/assets');
  471. $this->assertInternalType('array', $this->assets->getCss());
  472. $this->assertGreaterThan(0, (array) $this->assets->getCss());
  473. $this->assertInternalType('array', $this->assets->getJs());
  474. $this->assertCount(0, (array) $this->assets->getJs());
  475. $this->assets->reset();
  476. $this->assets->addDirJs('/system');
  477. $this->assertInternalType('array', $this->assets->getCss());
  478. $this->assertCount(0, (array) $this->assets->getCss());
  479. $this->assertInternalType('array', $this->assets->getJs());
  480. $this->assertGreaterThan(0, (array) $this->assets->getJs());
  481. $this->assets->reset();
  482. $this->assets->addDirJs('/system/assets');
  483. $this->assertInternalType('array', $this->assets->getCss());
  484. $this->assertCount(0, (array) $this->assets->getCss());
  485. $this->assertInternalType('array', $this->assets->getJs());
  486. $this->assertGreaterThan(0, (array) $this->assets->getJs());
  487. $this->assets->reset();
  488. $this->assets->addDir('/system/assets');
  489. $this->assertInternalType('array', $this->assets->getCss());
  490. $this->assertGreaterThan(0, (array) $this->assets->getCss());
  491. $this->assertInternalType('array', $this->assets->getJs());
  492. $this->assertGreaterThan(0, (array) $this->assets->getJs());
  493. //Use streams
  494. $this->assets->reset();
  495. $this->assets->addDir('system://assets');
  496. $this->assertInternalType('array', $this->assets->getCss());
  497. $this->assertGreaterThan(0, (array) $this->assets->getCss());
  498. $this->assertInternalType('array', $this->assets->getJs());
  499. $this->assertGreaterThan(0, (array) $this->assets->getJs());
  500. }
  501. }