Skip to content
Permalink
Browse files

Additional tests for filename generation.

  • Loading branch information...
markstory committed Jun 7, 2009
1 parent 44bffc5 commit 4141158f304504e6b0e11ac5be26d91d02afee2f
Showing with 34 additions and 0 deletions.
  1. +34 −0 cake/tests/cases/console/libs/tasks/test.test.php
@@ -404,6 +404,40 @@ function testBakeWithPlugin() {
$this->Task->bake('Helper', 'Form');
}
/**
* Test filename generation for each type + plugins
*
* @return void
**/
function testTestCaseFileName() {
$this->Task->path = '/my/path/tests/';
$result = $this->Task->testCaseFileName('Model', 'Post');
$expected = $this->Task->path . 'cases' . DS . 'models' . DS . 'post.test.php';
$this->assertEqual($result, $expected);
$result = $this->Task->testCaseFileName('Helper', 'Form');
$expected = $this->Task->path . 'cases' . DS . 'helpers' . DS . 'form.test.php';
$this->assertEqual($result, $expected);
$result = $this->Task->testCaseFileName('Controller', 'Posts');
$expected = $this->Task->path . 'cases' . DS . 'controllers' . DS . 'posts_controller.test.php';
$this->assertEqual($result, $expected);
$result = $this->Task->testCaseFileName('Behavior', 'Containable');
$expected = $this->Task->path . 'cases' . DS . 'behaviors' . DS . 'containable.test.php';
$this->assertEqual($result, $expected);
$result = $this->Task->testCaseFileName('Component', 'Auth');
$expected = $this->Task->path . 'cases' . DS . 'components' . DS . 'auth.test.php';
$this->assertEqual($result, $expected);
$this->Task->plugin = 'TestTest';
$result = $this->Task->testCaseFileName('Model', 'Post');
$expected = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'models' . DS . 'post.test.php';
$this->assertEqual($result, $expected);
}
/**
* test execute with a type defined
*

0 comments on commit 4141158

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