Skip to content

Commit

Permalink
Moving shell templates dirs.
Browse files Browse the repository at this point in the history
Updating TemplateTask to reflect changes in directories.
Updating test cases to use App::build()/App::path()
  • Loading branch information
markstory committed Jul 26, 2009
1 parent e9afb63 commit b4f4aee
Show file tree
Hide file tree
Showing 75 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion cake/console/libs/tasks/template.php
Expand Up @@ -52,7 +52,8 @@ function initialize() {
* @return array Array of bake themes that are installed.
**/
function _findThemes() {
$paths = $this->Dispatch->shellPaths;
$paths = App::path('shells');
array_unshift($paths, CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS);
$themes = array();
foreach ($paths as $path) {
$Folder =& new Folder($path . 'templates', false);
Expand Down
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 13 additions & 8 deletions cake/tests/cases/console/libs/tasks/template.test.php
Expand Up @@ -100,7 +100,7 @@ function testSet() {
* @return void
**/
function testFindingInstalledThemesForBake() {
$consoleLibs = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS;
$consoleLibs = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS;
$this->Task->Dispatch->shellPaths = array($consoleLibs);
$this->Task->initialize();
$this->assertEqual($this->Task->templatePaths, array('default' => $consoleLibs . 'templates' . DS . 'default' . DS));
Expand Down Expand Up @@ -138,10 +138,13 @@ function testGetThemePath() {
* @return void
**/
function testGenerate() {
$this->Task->Dispatch->shellPaths = array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS
);
App::build(array(
'shells' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS
)
));
$this->Task->initialize();
$this->Task->setReturnValue('in', 1);
$result = $this->Task->generate('classes', 'test_object', array('test' => 'foo'));
$expected = "I got rendered\nfoo";
$this->assertEqual($result, $expected);
Expand All @@ -154,10 +157,12 @@ function testGenerate() {
* @return void
**/
function testGenerateWithTemplateFallbacks() {
$this->Task->Dispatch->shellPaths = array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS,
CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS
);
App::build(array(
'shells' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS,
CAKE_CORE_INCLUDE_PATH . DS . 'console' . DS
)
));
$this->Task->initialize();
$this->Task->params['theme'] = 'test';
$this->Task->set(array(
Expand Down

0 comments on commit b4f4aee

Please sign in to comment.