Permalink
Browse files

Adding more tests for theme assets

  • Loading branch information...
1 parent 7b78e47 commit 8bc84948f0ee10772795782400e174111edec308 @phpnut phpnut committed Nov 27, 2009
@@ -358,6 +358,38 @@ function testImageTagWithTheme() {
)));
$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
@@ -0,0 +1 @@
+theme webroot css file
@@ -0,0 +1 @@
+override the theme webroot css file
@@ -0,0 +1 @@
+this is the webroot test asset css file

0 comments on commit 8bc8494

Please sign in to comment.