Skip to content
This repository
Browse code

Adding tests for -count and -records params

  • Loading branch information...
commit f0fdd257cf88274734cfd069a635d3ad329dfb81 1 parent 0b23274
Mark Story authored October 24, 2009
21  cake/tests/cases/console/libs/tasks/fixture.test.php
@@ -186,6 +186,27 @@ function testExecuteIntoAll() {
186 186
 	}
187 187
 
188 188
 /**
  189
+ * test using all() with -count and -records
  190
+ *
  191
+ * @return void
  192
+ **/
  193
+	function testAllWithCountAndRecordsFlags() {
  194
+		$this->Task->connection = 'test_suite';
  195
+		$this->Task->path = '/my/path/';
  196
+		$this->Task->args = array('all');
  197
+		$this->Task->params = array('count' => 10, 'records' => true);
  198
+		$this->Task->Model->setReturnValue('listAll', array('articles', 'comments'));
  199
+
  200
+		$filename = '/my/path/article_fixture.php';
  201
+		$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/')));
  202
+
  203
+		$filename = '/my/path/comment_fixture.php';
  204
+		$this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class CommentFixture/')));
  205
+		$this->Task->expectCallCount('createFile', 2);
  206
+		$this->Task->all();
  207
+	}
  208
+
  209
+/**
189 210
  * test interactive mode of execute
190 211
  *
191 212
  * @return void

0 notes on commit f0fdd25

Please sign in to comment.
Something went wrong with that request. Please try again.