/** * Test Javascript add/remove. * * @return void */ public function testJs() { $container = new ResourceContainer(); $container->addJs(['a', 'b', 'c']); $container->addJs('c'); $container->addJs('d'); $this->assertEquals([], array_diff(['a', 'b', 'c', 'd'], $container->getJs())); }
/** * Remove ignored js file before they're added to the resources * * @param array|string $js Javascript file (or array of files) to add (possibly * with extra settings from theme config appended to * each filename string). * * @return void */ public function addJs($js) { $js = $this->removeIgnoredFiles($js, $this->ignoredJsFiles); parent::addJs($js); }