Exemplo n.º 1
0
 public function addCssFiles(array $files)
 {
     Layout::addCss($files);
 }
Exemplo n.º 2
0
    public function testaddCss()
    {
        $css = <<<CSS
<style>
body {
  font-size: 100%;
}

a:focus {
  outline-offset: -2px;
}
</style>
CSS;
        $file = "/tmp/file1.css";
        file_put_contents($file, $css);
        //set modification time to a known value
        touch($file, 5000);
        Layout::addCss([$file]);
        $layout = new Layout(null, [], [$file]);
        $this->assertCount(1, $layout->getCssFiles());
        Layout::addCss([$file]);
        $this->assertCount(1, $layout->getCssFiles());
        $this->assertEquals("/css/5000_541e754eec404b8f7e5659038f70bb31.css", $layout->getCssScript());
    }