Adding tests for -count and -records params

This commit is contained in:
mark_story 2009-10-24 14:08:08 -04:00
parent 0b232742d9
commit f0fdd257cf

View file

@ -185,6 +185,27 @@ class FixtureTaskTest extends CakeTestCase {
$this->Task->execute();
}
/**
* test using all() with -count and -records
*
* @return void
**/
function testAllWithCountAndRecordsFlags() {
$this->Task->connection = 'test_suite';
$this->Task->path = '/my/path/';
$this->Task->args = array('all');
$this->Task->params = array('count' => 10, 'records' => true);
$this->Task->Model->setReturnValue('listAll', array('articles', 'comments'));
$filename = '/my/path/article_fixture.php';
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/')));
$filename = '/my/path/comment_fixture.php';
$this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class CommentFixture/')));
$this->Task->expectCallCount('createFile', 2);
$this->Task->all();
}
/**
* test interactive mode of execute
*