mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding tests for -count and -records params
This commit is contained in:
parent
0b232742d9
commit
f0fdd257cf
1 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue