Skip to content

Commit

Permalink
Add tests for previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 28, 2012
1 parent 9ff0739 commit 3b9f880
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
Expand Up @@ -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
*
Expand Down

0 comments on commit 3b9f880

Please sign in to comment.