Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test cases for model bake updates, refs #147

  • Loading branch information...
commit e4fa4759985754ae74e15d651ccbf3049b0775e4 1 parent 47fc47f
@predominant predominant authored
Showing with 13 additions and 2 deletions.
  1. +13 −2 cake/tests/cases/console/libs/tasks/model.test.php
View
15 cake/tests/cases/console/libs/tasks/model.test.php
@@ -594,8 +594,19 @@ function testBakeValidation() {
$this->assertPattern('/class Article extends AppModel \{/', $result);
$this->assertPattern('/\$name \= \'Article\'/', $result);
$this->assertPattern('/\$validate \= array\(/', $result);
- $pattern = '/' . preg_quote("'notempty' => array('rule' => array('notempty')),", '/') . '/';
- $this->assertPattern($pattern, $result);
+ $expected = <<< STRINGEND
+array(
+ 'notempty' => array(
+ 'rule' => array('notempty'),
+ //'message' => 'Your custom message here',
+ //'allowEmpty' => false,
+ //'required' => false,
+ //'last' => false, // Stop validation after this rule
+ //'on' => 'create', // Limit validation to 'create' or 'update' operations
+ ),
+STRINGEND;
+
+ $this->assertPattern('/' . preg_quote($expected, '/') . '/', $result);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.