Skip to content

Commit

Permalink
add more missed templates
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Nov 25, 2014
1 parent 5a76890 commit 6a08543
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/TestCase/Shell/Task/TemplateTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class TemplateTaskTest extends TestCase {
*/
public function setUp() {
parent::setUp();
$this->_compareBasePath = CORE_TESTS . 'bake_compare' . DS . 'Template' . DS;
$io = $this->getMock('Cake\Console\ConsoleIo', [], [], '', false);

$this->Task = $this->getMock('Cake\Shell\Task\TemplateTask',
Expand Down Expand Up @@ -62,7 +63,7 @@ public function testGenerate() {
$this->Task->expects($this->any())->method('in')->will($this->returnValue(1));

$result = $this->Task->generate('classes/test_object', array('test' => 'foo'));
$this->assertSameAsFile(__FUNCTION__ . '.php', $result);
$this->assertSameAsFile(__FUNCTION__ . '.ctp', $result);
}

/**
Expand All @@ -77,7 +78,7 @@ public function testGenerateWithTemplateOverride() {
'plugin' => 'Special'
));
$result = $this->Task->generate('config/routes');
$this->assertSameAsFile(__FUNCTION__ . '.php', $result);
$this->assertSameAsFile(__FUNCTION__ . '.ctp', $result);
}
/**
* test generate with a missing template in the chosen template.
Expand All @@ -97,6 +98,6 @@ public function testGenerateWithTemplateFallbacks() {
'namespace' => ''
));
$result = $this->Task->generate('tests/fixture');
$this->assertSameAsFile(__FUNCTION__ . '.php', $result);
$this->assertSameAsFile(__FUNCTION__ . '.ctp', $result);
}
}
1 change: 1 addition & 0 deletions tests/TestCase/Shell/Task/ViewTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class ViewTaskTest extends TestCase {
*/
public function setUp() {
parent::setUp();
$this->_compareBasePath = CORE_TESTS . 'bake_compare' . DS . 'View' . DS;

Configure::write('App.namespace', 'TestApp');
$this->_setupTask(['in', 'err', 'error', 'createFile', '_stop']);
Expand Down
2 changes: 2 additions & 0 deletions tests/bake_compare/Template/testGenerate.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
I got rendered
foo
19 changes: 19 additions & 0 deletions tests/bake_compare/Template/testGenerateWithTemplateFallbacks.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
namespace \Test\Fixture;

use Cake\TestSuite\Fixture\TestFixture;

/**
* ArticlesFixture
*
*/
class ArticlesFixture extends TestFixture {

/**
* Table name
*
* @var string
*/
public $table = 'articles';

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/**
* These are my routes. There are many like them but these are my own.
*/
use Cake\Routing\Router;

Router::plugin('Special', function($routes) {
$routes->fallbacks();
});

0 comments on commit 6a08543

Please sign in to comment.