Skip to content

Commit

Permalink
Changing more strings after renaming folders
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed May 13, 2011
1 parent 7ba60ff commit 649b863
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions lib/Cake/Test/Case/View/ThemeViewTest.php
Expand Up @@ -147,20 +147,20 @@ function tearDown() {
function testPluginThemedGetTemplate() {
$this->Controller->plugin = 'TestPlugin';
$this->Controller->name = 'TestPlugin';
$this->Controller->viewPath = 'tests';
$this->Controller->viewPath = 'Tests';
$this->Controller->action = 'index';
$this->Controller->theme = 'test_theme';

$ThemeView = new TestThemeView($this->Controller);
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'TestPlugin' . DS . 'tests' . DS .'index.ctp';
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'test_theme' . DS . 'Plugins' . DS . 'TestPlugin' . DS . 'Tests' . DS .'index.ctp';
$result = $ThemeView->getViewFileName('index');
$this->assertEqual($result, $expected);

$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'TestPlugin' . DS . 'layouts' . DS .'plugin_default.ctp';
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'test_theme' . DS . 'Plugins' . DS . 'TestPlugin' . DS . 'Layouts' . DS .'plugin_default.ctp';
$result = $ThemeView->getLayoutFileName('plugin_default');
$this->assertEqual($result, $expected);

$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'test_theme' . DS . 'layouts' . DS .'default.ctp';
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'test_theme' . DS . 'Layouts' . DS .'default.ctp';
$result = $ThemeView->getLayoutFileName('default');
$this->assertEqual($result, $expected);
}
Expand All @@ -174,31 +174,31 @@ function testPluginThemedGetTemplate() {
function testGetTemplate() {
$this->Controller->plugin = null;
$this->Controller->name = 'Pages';
$this->Controller->viewPath = 'pages';
$this->Controller->viewPath = 'Pages';
$this->Controller->action = 'display';
$this->Controller->params['pass'] = array('home');

$ThemeView = new TestThemeView($this->Controller);
$ThemeView->theme = 'test_theme';
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS .'pages' . DS .'home.ctp';
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS .'Pages' . DS .'home.ctp';
$result = $ThemeView->getViewFileName('home');
$this->assertEqual($result, $expected);

$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'test_theme' . DS . 'posts' . DS .'index.ctp';
$result = $ThemeView->getViewFileName('/posts/index');
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'test_theme' . DS . 'Posts' . DS .'index.ctp';
$result = $ThemeView->getViewFileName('/Posts/index');
$this->assertEqual($result, $expected);

$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'test_theme' . DS . 'layouts' . DS .'default.ctp';
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'test_theme' . DS . 'Layouts' . DS .'default.ctp';
$result = $ThemeView->getLayoutFileName();
$this->assertEqual($result, $expected);

$ThemeView->layoutPath = 'rss';
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'layouts' . DS . 'rss' . DS . 'default.ctp';
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'rss' . DS . 'default.ctp';
$result = $ThemeView->getLayoutFileName();
$this->assertEqual($result, $expected);

$ThemeView->layoutPath = 'emails' . DS . 'html';
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'layouts' . DS . 'emails' . DS . 'html' . DS . 'default.ctp';
$expected = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Layouts' . DS . 'emails' . DS . 'html' . DS . 'default.ctp';
$result = $ThemeView->getLayoutFileName();
$this->assertEqual($result, $expected);
}
Expand All @@ -213,7 +213,7 @@ function testGetTemplate() {
function testMissingView() {
$this->Controller->plugin = null;
$this->Controller->name = 'Pages';
$this->Controller->viewPath = 'pages';
$this->Controller->viewPath = 'Pages';
$this->Controller->action = 'display';
$this->Controller->theme = 'my_theme';

Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/View/ThemeView.php
Expand Up @@ -57,12 +57,12 @@ function _paths($plugin = null, $cached = true) {
if (!empty($this->theme)) {
$count = count($paths);
for ($i = 0; $i < $count; $i++) {
if (strpos($paths[$i], DS . 'plugins' . DS) === false
if (strpos($paths[$i], DS . 'Plugins' . DS) === false
&& strpos($paths[$i], DS . 'Cake' . DS . 'View') === false) {
if ($plugin) {
$themePaths[] = $paths[$i] . 'themed'. DS . $this->theme . DS . 'plugins' . DS . $plugin . DS;
$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS . 'Plugins' . DS . $plugin . DS;
}
$themePaths[] = $paths[$i] . 'themed'. DS . $this->theme . DS;
$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS;
}
}
$paths = array_merge($themePaths, $paths);
Expand Down

0 comments on commit 649b863

Please sign in to comment.