mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Exclude deprecated validators from bake.
Don't include deprecated validators in bake. Refs #6581
This commit is contained in:
parent
138adf0972
commit
9626f0e726
2 changed files with 6 additions and 6 deletions
|
@ -383,7 +383,7 @@ class ModelTask extends BakeTask {
|
||||||
if (class_exists('Validation')) {
|
if (class_exists('Validation')) {
|
||||||
$options = get_class_methods('Validation');
|
$options = get_class_methods('Validation');
|
||||||
}
|
}
|
||||||
$deprecatedOptions = array('notEmpty');
|
$deprecatedOptions = array('notEmpty', 'between', 'ssn');
|
||||||
$options = array_diff($options, $deprecatedOptions);
|
$options = array_diff($options, $deprecatedOptions);
|
||||||
sort($options);
|
sort($options);
|
||||||
$default = 1;
|
$default = 1;
|
||||||
|
|
|
@ -315,7 +315,7 @@ class ModelTaskTest extends CakeTestCase {
|
||||||
$this->Task->initValidations();
|
$this->Task->initValidations();
|
||||||
$this->Task->interactive = true;
|
$this->Task->interactive = true;
|
||||||
$this->Task->expects($this->any())->method('in')
|
$this->Task->expects($this->any())->method('in')
|
||||||
->will($this->onConsecutiveCalls('25', 'y', '19', 'n'));
|
->will($this->onConsecutiveCalls('24', 'y', '18', 'n'));
|
||||||
|
|
||||||
$result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false));
|
$result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false));
|
||||||
$expected = array('notBlank' => 'notBlank', 'maxLength' => 'maxLength');
|
$expected = array('notBlank' => 'notBlank', 'maxLength' => 'maxLength');
|
||||||
|
@ -333,7 +333,7 @@ class ModelTaskTest extends CakeTestCase {
|
||||||
$this->Task->interactive = true;
|
$this->Task->interactive = true;
|
||||||
|
|
||||||
$this->Task->expects($this->any())->method('in')
|
$this->Task->expects($this->any())->method('in')
|
||||||
->will($this->onConsecutiveCalls('999999', '25', 'n'));
|
->will($this->onConsecutiveCalls('999999', '24', 'n'));
|
||||||
|
|
||||||
$this->Task->expects($this->at(10))->method('out')
|
$this->Task->expects($this->at(10))->method('out')
|
||||||
->with($this->stringContains('make a valid'));
|
->with($this->stringContains('make a valid'));
|
||||||
|
@ -368,7 +368,7 @@ class ModelTaskTest extends CakeTestCase {
|
||||||
$this->Task->initValidations();
|
$this->Task->initValidations();
|
||||||
$this->Task->interactive = true;
|
$this->Task->interactive = true;
|
||||||
$this->Task->expects($this->any())->method('in')
|
$this->Task->expects($this->any())->method('in')
|
||||||
->will($this->onConsecutiveCalls('25', 'y', 's'));
|
->will($this->onConsecutiveCalls('24', 'y', 's'));
|
||||||
|
|
||||||
$result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false));
|
$result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false));
|
||||||
$expected = array('notBlank' => 'notBlank', '_skipFields' => true);
|
$expected = array('notBlank' => 'notBlank', '_skipFields' => true);
|
||||||
|
@ -384,7 +384,7 @@ class ModelTaskTest extends CakeTestCase {
|
||||||
$this->Task->initValidations();
|
$this->Task->initValidations();
|
||||||
$this->Task->interactive = true;
|
$this->Task->interactive = true;
|
||||||
$this->Task->expects($this->any())->method('in')
|
$this->Task->expects($this->any())->method('in')
|
||||||
->will($this->onConsecutiveCalls('25', 's'));
|
->will($this->onConsecutiveCalls('24', 's'));
|
||||||
|
|
||||||
$result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false));
|
$result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false));
|
||||||
$expected = array('notBlank' => 'notBlank', '_skipFields' => true);
|
$expected = array('notBlank' => 'notBlank', '_skipFields' => true);
|
||||||
|
@ -400,7 +400,7 @@ class ModelTaskTest extends CakeTestCase {
|
||||||
public function testInteractiveDoValidationWithSkipping() {
|
public function testInteractiveDoValidationWithSkipping() {
|
||||||
$this->Task->expects($this->any())
|
$this->Task->expects($this->any())
|
||||||
->method('in')
|
->method('in')
|
||||||
->will($this->onConsecutiveCalls('36', '25', 'n', '11', 's'));
|
->will($this->onConsecutiveCalls('34', '24', 'n', '10', 's'));
|
||||||
$this->Task->interactive = true;
|
$this->Task->interactive = true;
|
||||||
$Model = $this->getMock('Model');
|
$Model = $this->getMock('Model');
|
||||||
$Model->primaryKey = 'id';
|
$Model->primaryKey = 'id';
|
||||||
|
|
Loading…
Reference in a new issue