mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Merge branch '1.3' into 1.3-misc
This commit is contained in:
commit
95135d18cc
3 changed files with 24 additions and 4 deletions
|
@ -42,7 +42,14 @@ if (!empty($validate)):
|
|||
foreach ($validate as $field => $validations):
|
||||
echo "\t\t'$field' => array(\n";
|
||||
foreach ($validations as $key => $validator):
|
||||
echo "\t\t\t'$key' => array('rule' => array('$validator')),\n";
|
||||
echo "\t\t\t'$key' => array(\n";
|
||||
echo "\t\t\t\t'rule' => array('$validator'),\n";
|
||||
echo "\t\t\t\t//'message' => 'Your custom message here',\n";
|
||||
echo "\t\t\t\t//'allowEmpty' => false,\n";
|
||||
echo "\t\t\t\t//'required' => false,\n";
|
||||
echo "\t\t\t\t//'last' => false, // Stop validation after this rule\n";
|
||||
echo "\t\t\t\t//'on' => 'create', // Limit validation to 'create' or 'update' operations\n";
|
||||
echo "\t\t\t),\n";
|
||||
endforeach;
|
||||
echo "\t\t),\n";
|
||||
endforeach;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2115,7 +2115,9 @@ class DispatcherTest extends CakeTestCase {
|
|||
$_SERVER['PHP_SELF'] = '/';
|
||||
|
||||
Router::reload();
|
||||
Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS));
|
||||
App::build(array(
|
||||
'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
|
||||
));
|
||||
|
||||
$dispatcher =& new Dispatcher();
|
||||
$dispatcher->base = false;
|
||||
|
|
Loading…
Reference in a new issue