Exemplo n.º 1
0
 public function testAddDirCss()
 {
     $this->assets->addDirCss('/system');
     $this->assertTrue(is_array($this->assets->getCss()));
     $this->assertTrue(count($this->assets->getCss()) > 0);
     $this->assertTrue(is_array($this->assets->getJs()));
     $this->assertTrue(count($this->assets->getJs()) == 0);
     $this->assets->reset();
     $this->assets->addDirCss('/system/assets');
     $this->assertTrue(is_array($this->assets->getCss()));
     $this->assertTrue(count($this->assets->getCss()) > 0);
     $this->assertTrue(is_array($this->assets->getJs()));
     $this->assertTrue(count($this->assets->getJs()) == 0);
     $this->assets->reset();
     $this->assets->addDirJs('/system');
     $this->assertTrue(is_array($this->assets->getCss()));
     $this->assertTrue(count($this->assets->getCss()) == 0);
     $this->assertTrue(is_array($this->assets->getJs()));
     $this->assertTrue(count($this->assets->getJs()) > 0);
     $this->assets->reset();
     $this->assets->addDirJs('/system/assets');
     $this->assertTrue(is_array($this->assets->getCss()));
     $this->assertTrue(count($this->assets->getCss()) == 0);
     $this->assertTrue(is_array($this->assets->getJs()));
     $this->assertTrue(count($this->assets->getJs()) > 0);
     $this->assets->reset();
     $this->assets->addDir('/system/assets');
     $this->assertTrue(is_array($this->assets->getCss()));
     $this->assertTrue(count($this->assets->getCss()) > 0);
     $this->assertTrue(is_array($this->assets->getJs()));
     $this->assertTrue(count($this->assets->getJs()) > 0);
     //Use streams
     $this->assets->reset();
     $this->assets->addDir('system://assets');
     $this->assertTrue(is_array($this->assets->getCss()));
     $this->assertTrue(count($this->assets->getCss()) > 0);
     $this->assertTrue(is_array($this->assets->getJs()));
     $this->assertTrue(count($this->assets->getJs()) > 0);
 }
 /**
  * Add plugin specific assets
  * @param Page $page
  * @param Assets $assets
  */
 protected function addAssets(Page $page, Assets $assets)
 {
     $pluginAssets = [];
     if (!empty($page->header()->videoembed['assets'])) {
         $pluginAssets = (array) $page->header()->videoembed['assets'];
     }
     foreach ($pluginAssets as $asset) {
         $assets->add($asset);
     }
 }