mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix coding standards.
This commit is contained in:
parent
2ad406ab64
commit
16a1a0ee79
5 changed files with 17 additions and 26 deletions
|
@ -302,7 +302,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
public function getField($name = null) {
|
||||
if ($name !== null && !empty($this->_fields[$name])) {
|
||||
return $this->_fields[$name];
|
||||
} elseif ($name !==null) {
|
||||
} elseif ($name !== null) {
|
||||
return null;
|
||||
}
|
||||
return $this->_fields;
|
||||
|
|
|
@ -206,7 +206,7 @@ class CakeValidationRule {
|
|||
* @return boolean
|
||||
*/
|
||||
public function isLast() {
|
||||
return (bool) $this->last;
|
||||
return (bool)$this->last;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -269,7 +269,7 @@ class CakeValidationRule {
|
|||
if (isset($methods[$rule])) {
|
||||
$this->_ruleParams[] = array_merge($validator, $this->_passedOptions);
|
||||
$this->_ruleParams[0] = array($field => $this->_ruleParams[0]);
|
||||
$this->_valid = call_user_func_array($methods[$rule], $this->_ruleParams);
|
||||
$this->_valid = call_user_func_array($methods[$rule], $this->_ruleParams);
|
||||
} elseif (class_exists('Validation') && method_exists('Validation', $this->_rule)) {
|
||||
$this->_valid = call_user_func_array(array('Validation', $this->_rule), $this->_ruleParams);
|
||||
} elseif (is_string($validator['rule'])) {
|
||||
|
|
|
@ -34,8 +34,8 @@ class ModelTest extends PHPUnit_Framework_TestSuite {
|
|||
public static function suite() {
|
||||
$suite = new PHPUnit_Framework_TestSuite('All Model related class tests');
|
||||
|
||||
$suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'Validator' . DS .'CakeValidationSetTest.php');
|
||||
$suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'Validator' . DS .'CakeValidationRuleTest.php');
|
||||
$suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'Validator' . DS . 'CakeValidationSetTest.php');
|
||||
$suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'Validator' . DS . 'CakeValidationRuleTest.php');
|
||||
$suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'ModelReadTest.php');
|
||||
$suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'ModelWriteTest.php');
|
||||
$suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'ModelDeleteTest.php');
|
||||
|
|
|
@ -1090,8 +1090,8 @@ class ModelValidationTest extends BaseModelTest {
|
|||
$expected = array(
|
||||
'Article' => true,
|
||||
'Comment' => array(
|
||||
true,
|
||||
true
|
||||
true,
|
||||
true
|
||||
)
|
||||
);
|
||||
$result = $TestModel->saveAll($data, array('validate' => 'only', 'atomic' => false, 'deep' => true));
|
||||
|
@ -1109,8 +1109,8 @@ class ModelValidationTest extends BaseModelTest {
|
|||
$expected = array(
|
||||
'Article' => true,
|
||||
'Comment' => array(
|
||||
false,
|
||||
true
|
||||
false,
|
||||
true
|
||||
)
|
||||
);
|
||||
$result = $TestModel->saveAll($data, array('validate' => 'only', 'atomic' => false, 'deep' => true));
|
||||
|
@ -1152,8 +1152,8 @@ class ModelValidationTest extends BaseModelTest {
|
|||
$expected = array(
|
||||
'Article' => true,
|
||||
'Comment' => array(
|
||||
true,
|
||||
true
|
||||
true,
|
||||
true
|
||||
)
|
||||
);
|
||||
$result = $TestModel->saveAll($data, array('validate' => 'only', 'atomic' => false, 'deep' => true));
|
||||
|
@ -1171,8 +1171,8 @@ class ModelValidationTest extends BaseModelTest {
|
|||
$expected = array(
|
||||
'Article' => true,
|
||||
'Comment' => array(
|
||||
true,
|
||||
false
|
||||
true,
|
||||
false
|
||||
)
|
||||
);
|
||||
$result = $TestModel->saveAll($data, array('validate' => 'only', 'atomic' => false, 'deep' => true));
|
||||
|
@ -1394,8 +1394,8 @@ class ModelValidationTest extends BaseModelTest {
|
|||
$expected = array(
|
||||
'Article' => true,
|
||||
'Comment' => array(
|
||||
true,
|
||||
true
|
||||
true,
|
||||
true
|
||||
)
|
||||
);
|
||||
$result = $TestModel->saveAll($data, array('validate' => 'only', 'atomic' => false, 'deep' => false));
|
||||
|
@ -1425,8 +1425,8 @@ class ModelValidationTest extends BaseModelTest {
|
|||
$expected = array(
|
||||
'Article' => true,
|
||||
'Comment' => array(
|
||||
true,
|
||||
true
|
||||
true,
|
||||
true
|
||||
)
|
||||
);
|
||||
$result = $TestModel->saveAll($data, array('validate' => 'only', 'atomic' => false, 'deep' => false));
|
||||
|
|
|
@ -26,15 +26,6 @@ App::uses('CakeValidationRule', 'Model/Validator');
|
|||
*/
|
||||
class CakeValidationRuleTest extends CakeTestCase {
|
||||
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Auxiliary method to test custom validators
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue