diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index 23d4d96c7..05dcd5e46 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -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 diff --git a/cake/tests/test_app/views/themed/test_theme/webroot/css/theme_webroot.css b/cake/tests/test_app/views/themed/test_theme/webroot/css/theme_webroot.css new file mode 100644 index 000000000..12e29a565 --- /dev/null +++ b/cake/tests/test_app/views/themed/test_theme/webroot/css/theme_webroot.css @@ -0,0 +1 @@ +theme webroot css file \ No newline at end of file diff --git a/cake/tests/test_app/webroot/theme/test_theme/css/theme_webroot.css b/cake/tests/test_app/webroot/theme/test_theme/css/theme_webroot.css new file mode 100644 index 000000000..f65d3e08a --- /dev/null +++ b/cake/tests/test_app/webroot/theme/test_theme/css/theme_webroot.css @@ -0,0 +1 @@ +override the theme webroot css file \ No newline at end of file diff --git a/cake/tests/test_app/webroot/theme/test_theme/css/webroot_test.css b/cake/tests/test_app/webroot/theme/test_theme/css/webroot_test.css new file mode 100644 index 000000000..83c3bc4d7 --- /dev/null +++ b/cake/tests/test_app/webroot/theme/test_theme/css/webroot_test.css @@ -0,0 +1 @@ +this is the webroot test asset css file \ No newline at end of file