Browse Source

Trying to fix occasional error during FixtureTaskTest.

mark_story 14 years ago
parent
commit
4fda085928
1 changed files with 8 additions and 5 deletions
  1. 8 5
      lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php

+ 8 - 5
lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php

@@ -243,16 +243,19 @@ class FixtureTaskTest extends CakeTestCase {
 		$this->Task->connection = 'test';
 		$this->Task->path = '/my/path/';
 		$this->Task->args = array('all');
-		$this->Task->Model->expects($this->any())->method('listAll')
+		$this->Task->Model->expects($this->any())
+			->method('listAll')
 			->will($this->returnValue(array('articles', 'comments')));
 
 		$filename = '/my/path/ArticleFixture.php';
-		$this->Task->expects($this->at(0))->method('createFile')
-			->with($filename, new PHPUnit_Framework_Constraint_PCREMatch('/class ArticleFixture/'));
+		$this->Task->expects($this->at(0))
+			->method('createFile')
+			->with($filename, $this->stringContains('class ArticleFixture'));
 
 		$filename = '/my/path/CommentFixture.php';
-		$this->Task->expects($this->at(1))->method('createFile')
-			->with($filename, new PHPUnit_Framework_Constraint_PCREMatch('/class CommentFixture/'));
+		$this->Task->expects($this->at(1))
+			->method('createFile')
+			->with($filename, $this->stringContains('class CommentFixture'));
 
 		$this->Task->execute();
 	}