Merge branch '1.3' into 1.3-misc

This commit is contained in:
Mark Story 2010-01-03 23:36:32 -05:00
commit 95135d18cc
3 changed files with 24 additions and 4 deletions

View file

@ -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;

View file

@ -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);
}
/**

View file

@ -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;