Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Additional tests for filename generation.

  • Loading branch information...
commit 4141158f304504e6b0e11ac5be26d91d02afee2f 1 parent 44bffc5
Mark Story markstory authored
Showing with 34 additions and 0 deletions.
  1. +34 −0 cake/tests/cases/console/libs/tasks/test.test.php
34 cake/tests/cases/console/libs/tasks/test.test.php
View
@@ -405,6 +405,40 @@ function testBakeWithPlugin() {
}
/**
+ * 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
*
* @return void
Please sign in to comment.
Something went wrong with that request. Please try again.