Skip to content
Permalink
Browse files

Adding tests for -count and -records params

  • Loading branch information...
markstory committed Oct 24, 2009
1 parent 0b23274 commit f0fdd257cf88274734cfd069a635d3ad329dfb81
Showing with 21 additions and 0 deletions.
  1. +21 −0 cake/tests/cases/console/libs/tasks/fixture.test.php
@@ -185,6 +185,27 @@ function testExecuteIntoAll() {
$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
*

0 comments on commit f0fdd25

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