Browse Source

`Captcha` references removed from unit tests

tags/3.0.0-alpha1
Paul Klimov 7 years ago
parent
commit
5e2c16da66
  1. 3
      framework/validators/Validator.php
  2. 2
      tests/data/base/Singer.php
  3. 3
      tests/framework/di/ServiceLocatorTest.php

3
framework/validators/Validator.php

@ -10,7 +10,6 @@ namespace yii\validators;
use Yii;
use yii\base\Component;
use yii\base\NotSupportedException;
use yii\captcha\CaptchaValidator;
/**
* Validator is the base class for all validators.
@ -23,7 +22,6 @@ use yii\captcha\CaptchaValidator;
* be referenced using short names. They are listed as follows:
*
* - `boolean`: [[BooleanValidator]]
* - `captcha`: [[\yii\captcha\CaptchaValidator]]
* - `compare`: [[CompareValidator]]
* - `date`: [[DateValidator]]
* - `datetime`: [[DateValidator]]
@ -61,7 +59,6 @@ class Validator extends Component
*/
public static $builtInValidators = [
'boolean' => BooleanValidator::class,
'captcha' => CaptchaValidator::class,
'compare' => CompareValidator::class,
'date' => DateValidator::class,
'datetime' => [

2
tests/data/base/Singer.php

@ -23,7 +23,7 @@ class Singer extends Model
return [
[['lastName'], 'default', 'value' => 'Lennon'],
[['lastName'], 'required'],
[['underscore_style'], 'yii\captcha\CaptchaValidator'],
[['underscore_style'], 'safe'],
[['test'], 'required', 'when' => function ($model) { return $model->firstName === 'cebe'; }],
];
}

3
tests/framework/di/ServiceLocatorTest.php

@ -9,6 +9,7 @@ namespace yiiunit\framework\di;
use yii\base\BaseObject;
use yii\di\ServiceLocator;
use yii\widgets\InputWidget;
use yiiunit\TestCase;
class Creator
@ -96,7 +97,7 @@ class ServiceLocatorTest extends TestCase
'components' => [
'captcha' => [
'name' => 'foo bar',
'class' => 'yii\captcha\Captcha',
'class' => InputWidget::class,
],
],
];

Loading…
Cancel
Save