/**
  * @loadFixture
  * @test
  */
 public function defaultCss()
 {
     $headBlock = new Mage_Page_Block_Html_Head();
     $headBlock->addCss('css/styles.css');
     $html = $headBlock->getCssJsHtml();
     $this->assertContains('css/styles.css', $html);
 }
 /**
  * @loadFixture
  * @test
  */
 public function checkVersionOnUnmergedCssFiles()
 {
     $this->assertEquals('1', Mage::getStoreConfig('dev/css/addTstampToCssFiles'));
     $headBlock = new Mage_Page_Block_Html_Head();
     $headBlock->addCss('css/styles.css');
     $html = $headBlock->getCssJsHtml();
     $this->assertNotContains('css/styles.css', $html);
     $this->assertRegExp('/[0-9]{10}\\.css/', $html);
     $this->assertRegExp('/css\\/styles\\.[0-9]{10}\\.css/', $html);
 }
示例#3
0
 /**
  * @loadFixture
  * @test
  */
 public function defaultMergeCss()
 {
     $headBlock = new Mage_Page_Block_Html_Head();
     $headBlock->addCss('css/styles.css');
     $html = $headBlock->getCssJsHtml();
     $this->assertNotContains('css/styles.css', $html);
     $matches = array();
     $result = preg_match('/\\/media\\/css\\/[u|s]\\.[a-f0-9]{32}\\.[0-9]{10}\\.css/', $html, $matches);
     $this->assertEquals(1, $result);
     $file = Mage::getBaseDir() . $matches[0];
     $this->assertTrue(file_exists($file));
     $this->assertContains('/* FILE: styles.css */', file_get_contents($file));
 }
示例#4
0
 /**
  * @expectedException Magento_Exception
  */
 public function testAddCssException()
 {
     $this->_block->addCss('');
 }