Permalink
Browse files

Add tests for previous commit.

  • Loading branch information...
1 parent 9ff0739 commit 3b9f88030ef9d6e2f8fbcb6ded00fffd05273d62 @markstory markstory committed Jan 27, 2012
Showing with 34 additions and 0 deletions.
  1. +34 −0 lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
@@ -502,6 +502,40 @@ public function testGenerateConstructor() {
$this->assertEquals($expected, $result);
}
+/**
+ * Test generateUses()
+ */
+ public function testGenerateUses() {
+ $result = $this->Task->generateUses('model', 'Model', 'Post');
+ $expected = array(
+ array('Post', 'Model')
+ );
+ $this->assertEquals($expected, $result);
+
+ $result = $this->Task->generateUses('controller', 'Controller', 'PostsController');
+ $expected = array(
+ array('PostsController', 'Controller')
+ );
+ $this->assertEquals($expected, $result);
+
+ $result = $this->Task->generateUses('helper', 'View/Helper', 'FormHelper');
+ $expected = array(
+ array('View', 'View'),
+ array('Helper', 'View'),
+ array('FormHelper', 'View/Helper'),
+ );
+ $this->assertEquals($expected, $result);
+
+ $result = $this->Task->generateUses('component', 'Controller/Component', 'AuthComponent');
+ $expected = array(
+ array('ComponentCollection', 'Controller'),
+ array('Component', 'Controller'),
+ array('AuthComponent', 'Controller/Component')
+ );
+ $this->assertEquals($expected, $result);
+ }
+
+
/**
* Test that mock class generation works for the appropriate classes
*

0 comments on commit 3b9f880

Please sign in to comment.