Skip to content
Permalink
Browse files

Fix cell paths in plugins not being able to use relative paths.

Refs #3945
  • Loading branch information...
markstory committed Jul 18, 2014
1 parent ac702ca commit 6ae765c7fa4120c11d4749dd7d3e9319c06abe9a
Showing with 13 additions and 0 deletions.
  1. +2 −0 src/View/View.php
  2. +11 −0 tests/TestCase/View/CellTest.php
@@ -852,6 +852,8 @@ protected function _getViewFileName($name = null) {
$name = trim($name, DS);
} elseif (!$plugin || $this->viewPath !== $this->name) {
$name = $this->viewPath . DS . $subDir . $name;
} else {
$name = DS . $subDir . $name;
}
}
@@ -157,6 +157,17 @@ public function testPluginCell() {
$this->assertContains('hello world!', "{$cell}");
}
/**
* Test that plugin cells can render other view templates.
*
* @return void
*/
public function testPluginCellAlternateTemplate() {
$cell = $this->View->cell('TestPlugin.Dummy::echoThis', ['msg' => 'hello world!']);
$cell->template = '../../Element/translate';
$this->assertContains('This is a translatable string', "{$cell}");
}
/**
* Tests that using an unexisting cell throws an exception.
*

0 comments on commit 6ae765c

Please sign in to comment.
You can’t perform that action at this time.