mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Test cases for model bake updates, refs #147
This commit is contained in:
parent
47fc47ff59
commit
e4fa475998
1 changed files with 13 additions and 2 deletions
|
@ -594,8 +594,19 @@ class ModelTaskTest extends CakeTestCase {
|
|||
$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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue