Skip to content

Commit

Permalink
Test cases for model bake updates, refs #147
Browse files Browse the repository at this point in the history
  • Loading branch information
predominant committed Jan 1, 2010
1 parent 47fc47f commit e4fa475
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cake/tests/cases/console/libs/tasks/model.test.php
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit e4fa475

Please sign in to comment.