Skip to content

Commit

Permalink
template paths don't exist as a concept anymore
Browse files Browse the repository at this point in the history
replaced by standard view functionality i.e. plugins
  • Loading branch information
AD7six committed Nov 14, 2014
1 parent 63b4ad5 commit 865ecc4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 57 deletions.
8 changes: 0 additions & 8 deletions src/Shell/Task/TemplateTask.php
Expand Up @@ -34,14 +34,6 @@ class TemplateTask extends Shell {
use ConventionsTrait;
use ViewVarsTrait;

/**
* Paths to look for templates on.
* Contains a list of $template => $path
*
* @var array
*/
public $templatePaths = [];

/**
* BakeView instance
*
Expand Down
49 changes: 0 additions & 49 deletions tests/TestCase/Shell/Task/TemplateTaskTest.php
Expand Up @@ -48,55 +48,6 @@ public function tearDown() {
unset($this->Task);
}

/**
* test finding templates installed in
*
* @return void
*/
public function testFindingInstalledTemplatesForBake() {
$consoleLibs = CAKE . 'Template' . DS;
$this->Task->initialize();
$this->assertPathEquals($this->Task->templatePaths['default'], $consoleLibs . 'Bake/default/');
}

/**
* test using an invalid template name.
*
* @expectedException \RuntimeException
* @expectedExceptionMessage Unable to locate "nope" bake template
* @return void
*/
public function testGetTemplatePathInvalid() {
$defaultTemplate = CAKE . 'Template/Bake/default/';
$this->Task->templatePaths = ['default' => $defaultTemplate];
$this->Task->params['template'] = 'nope';
$this->Task->getTemplatePath();
}

/**
* test getting the correct template name. Ensure that with only one template, or a template param
* that the user is not bugged. If there are more, find and return the correct template name
*
* @return void
*/
public function testGetTemplatePath() {
$defaultTemplate = CAKE . 'Template/Bake/default/';
$this->Task->templatePaths = ['default' => $defaultTemplate];

$result = $this->Task->getTemplatePath();
$this->assertEquals($defaultTemplate, $result);

$this->Task->templatePaths = ['other' => '/some/path', 'default' => $defaultTemplate];
$this->Task->params['template'] = 'other';
$result = $this->Task->getTemplatePath();
$this->assertEquals('/some/path', $result);

$this->Task->params = array();
$result = $this->Task->getTemplatePath();
$this->assertEquals($defaultTemplate, $result);
$this->assertEquals('default', $this->Task->params['template']);
}

/**
* test generate
*
Expand Down

0 comments on commit 865ecc4

Please sign in to comment.