public function testFactory() { $link = Link::make('stylesheet', 'text/css', 'theme.css', 'screen'); $this->assertEquals('stylesheet', $link->getRel()); $this->assertEquals('text/css', $link->getType()); $this->assertEquals('theme.css', $link->getHref()); $this->assertEquals('screen', $link->getMedia()); }
public function testAddLink() { $this->layout->addLink(Link::make("stylesheet", 'text/css', 'theme.css')); $html = $this->layout->render(); $this->assertContains('<link rel="stylesheet" href="theme.css" type="text/css">', $html); }
/** * Procesa los recursos CSS a incluir en el documento */ private function processCssAssets() { /** @var StablePriorityQueue $css_assets */ $css_assets = $this->cssAssets; while (!$css_assets->isEmpty()) { $asset = $css_assets->extract(); $link = new Link(); $link->setHref($asset['asset'])->setMedia($asset['media'])->setType('text/css')->setRel('stylesheet'); $this->addLink($link, 0); } }