Adding more tests for theme assets

This commit is contained in:
phpnut 2009-11-27 10:27:15 -06:00
parent 7b78e475ca
commit 8bc84948f0
4 changed files with 35 additions and 0 deletions

View file

@ -358,6 +358,38 @@ class HtmlHelperTest extends CakeTestCase {
)));
$this->Html->webroot = $webroot;
}
/**
* test theme assets in main webroot path
*
* @access public
* @return void
*/
function testThemeAssetsInMainWebrootPath() {
App::build(array(
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$webRoot = Configure::read('App.www_root');
Configure::write('App.www_root', TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'webroot' . DS);
$webroot = $this->Html->webroot;
$this->Html->theme = 'test_theme';
$result = $this->Html->css('webroot_test');
$expected = array(
'link' => array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => 'preg:/.*theme\/test_theme\/css\/webroot_test\.css/')
);
$this->assertTags($result, $expected);
$webroot = $this->Html->webroot;
$this->Html->theme = 'test_theme';
$result = $this->Html->css('theme_webroot');
$expected = array(
'link' => array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => 'preg:/.*theme\/test_theme\/css\/theme_webroot\.css/')
);
$this->assertTags($result, $expected);
Configure::write('App.www_root', $webRoot);
}
/**
* testStyle method

View file

@ -0,0 +1 @@
theme webroot css file

View file

@ -0,0 +1 @@
override the theme webroot css file

View file

@ -0,0 +1 @@
this is the webroot test asset css file