Browse Source

fixed failing validator tests

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
3631890cba
  1. 6
      tests/unit/framework/validators/BooleanValidatorTest.php
  2. 5
      tests/unit/framework/validators/CompareValidatorTest.php
  3. 6
      tests/unit/framework/validators/DateValidatorTest.php
  4. 6
      tests/unit/framework/validators/DefaultValueValidatorTest.php
  5. 6
      tests/unit/framework/validators/EmailValidatorTest.php
  6. 1
      tests/unit/framework/validators/ExistValidatorTest.php
  7. 6
      tests/unit/framework/validators/FilterValidatorTest.php
  8. 6
      tests/unit/framework/validators/NumberValidatorTest.php
  9. 6
      tests/unit/framework/validators/RangeValidatorTest.php
  10. 6
      tests/unit/framework/validators/RegularExpressionValidatorTest.php
  11. 6
      tests/unit/framework/validators/RequiredValidatorTest.php
  12. 1
      tests/unit/framework/validators/UniqueValidatorTest.php
  13. 6
      tests/unit/framework/validators/UrlValidatorTest.php
  14. 5
      tests/unit/framework/validators/ValidatorTest.php

6
tests/unit/framework/validators/BooleanValidatorTest.php

@ -10,6 +10,12 @@ use yiiunit\TestCase;
*/
class BooleanValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateValue()
{
$val = new BooleanValidator;

5
tests/unit/framework/validators/CompareValidatorTest.php

@ -10,6 +10,11 @@ use yiiunit\TestCase;
class CompareValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateValueException()
{

6
tests/unit/framework/validators/DateValidatorTest.php

@ -10,6 +10,12 @@ use yiiunit\TestCase;
class DateValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testEnsureMessageIsSet()
{
$val = new DateValidator;

6
tests/unit/framework/validators/DefaultValueValidatorTest.php

@ -8,6 +8,12 @@ use yiiunit\TestCase;
*/
class DefaultValueValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateAttribute()
{
$val = new DefaultValueValidator;

6
tests/unit/framework/validators/EmailValidatorTest.php

@ -11,6 +11,12 @@ use yiiunit\TestCase;
*/
class EmailValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateValue()
{
$validator = new EmailValidator();

1
tests/unit/framework/validators/ExistValidatorTest.php

@ -18,6 +18,7 @@ class ExistValidatorTest extends DatabaseTestCase
public function setUp()
{
parent::setUp();
$this->mockApplication();
ActiveRecord::$db = $this->getConnection();
}

6
tests/unit/framework/validators/FilterValidatorTest.php

@ -9,6 +9,12 @@ use yiiunit\TestCase;
class FilterValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testAssureExceptionOnInit()
{
$this->setExpectedException('yii\base\InvalidConfigException');

6
tests/unit/framework/validators/NumberValidatorTest.php

@ -9,6 +9,12 @@ use yiiunit\TestCase;
class NumberValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testEnsureMessageOnInit()
{
$val = new NumberValidator;

6
tests/unit/framework/validators/RangeValidatorTest.php

@ -9,6 +9,12 @@ use yiiunit\TestCase;
class RangeValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testInitException()
{
$this->setExpectedException('yii\base\InvalidConfigException', 'The "range" property must be set.');

6
tests/unit/framework/validators/RegularExpressionValidatorTest.php

@ -9,6 +9,12 @@ use yiiunit\TestCase;
class RegularExpressionValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateValue()
{
$val = new RegularExpressionValidator(['pattern' => '/^[a-zA-Z0-9](\.)?([^\/]*)$/m']);

6
tests/unit/framework/validators/RequiredValidatorTest.php

@ -8,6 +8,12 @@ use yiiunit\TestCase;
class RequiredValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateValueWithDefaults()
{
$val = new RequiredValidator();

1
tests/unit/framework/validators/UniqueValidatorTest.php

@ -19,6 +19,7 @@ class UniqueValidatorTest extends DatabaseTestCase
public function setUp()
{
parent::setUp();
$this->mockApplication();
ActiveRecord::$db = $this->getConnection();
}

6
tests/unit/framework/validators/UrlValidatorTest.php

@ -9,6 +9,12 @@ use yiiunit\TestCase;
*/
class UrlValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateValue()
{
$val = new UrlValidator;

5
tests/unit/framework/validators/ValidatorTest.php

@ -12,6 +12,11 @@ use yiiunit\TestCase;
class ValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
protected function getTestModel($additionalAttributes = [])
{

Loading…
Cancel
Save