Skip to content
This repository
Browse code

Test cases for model bake updates, refs #147

  • Loading branch information...
commit e4fa4759985754ae74e15d651ccbf3049b0775e4 1 parent 47fc47f
Graham Weldon authored January 01, 2010
15  cake/tests/cases/console/libs/tasks/model.test.php
@@ -594,8 +594,19 @@ function testBakeValidation() {
594 594
 		$this->assertPattern('/class Article extends AppModel \{/', $result);
595 595
 		$this->assertPattern('/\$name \= \'Article\'/', $result);
596 596
 		$this->assertPattern('/\$validate \= array\(/', $result);
597  
-		$pattern = '/' . preg_quote("'notempty' => array('rule' => array('notempty')),", '/') . '/';
598  
-		$this->assertPattern($pattern, $result);
  597
+		$expected = <<< STRINGEND
  598
+array(
  599
+			'notempty' => array(
  600
+				'rule' => array('notempty'),
  601
+				//'message' => 'Your custom message here',
  602
+				//'allowEmpty' => false,
  603
+				//'required' => false,
  604
+				//'last' => false, // Stop validation after this rule
  605
+				//'on' => 'create', // Limit validation to 'create' or 'update' operations
  606
+			),
  607
+STRINGEND;
  608
+
  609
+		$this->assertPattern('/' . preg_quote($expected, '/') . '/', $result);
599 610
 	}
600 611
 
601 612
 /**

0 notes on commit e4fa475

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