From f0fdd257cf88274734cfd069a635d3ad329dfb81 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 24 Oct 2009 14:08:08 -0400 Subject: [PATCH] Adding tests for -count and -records params --- .../cases/console/libs/tasks/fixture.test.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 71873155f..a66ceecaf 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -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 *