Rename rule "False" to "FalseVal"

This commit is contained in:
Henrique Moody 2015-10-07 11:35:39 -03:00
parent 0ae5d25de7
commit fef01d7e09
9 changed files with 33 additions and 33 deletions

View file

@ -33,7 +33,7 @@ All notable changes of the Respect\Validation releases are documented in this fi
- On exceptions, do not display parent message then rule has only one child (#407)
- On exceptions, improve `Object` conversion to string (#399)
- On exceptions, improve conversion of all values by using JSON (#399)
- Use `filter_var()` on "True" and "False" rules (#409)
- Use `filter_var()` on "True" and "FalseVal" rules (#409)
### Removed

View file

@ -1,21 +0,0 @@
# False
- `v::false()`
Validates if a value is considered as `false`.
```php
v::false()->validate(false); //true
v::false()->validate(0); //true
v::false()->validate('0'); //true
v::false()->validate('false'); //true
v::false()->validate('off'); //true
v::false()->validate('no'); //true
v::false()->validate('0.5'); //false
v::false()->validate('2'); //false
```
***
See also:
* [True](True.md)

21
docs/FalseVal.md Normal file
View file

@ -0,0 +1,21 @@
# FalseVal
- `v::falseVal()`
Validates if a value is considered as `false`.
```php
v::falseVal()->validate(false); //true
v::falseVal()->validate(0); //true
v::falseVal()->validate('0'); //true
v::falseVal()->validate('false'); //true
v::falseVal()->validate('off'); //true
v::falseVal()->validate('no'); //true
v::falseVal()->validate('0.5'); //false
v::falseVal()->validate('2'); //false
```
***
See also:
* [True](True.md)

View file

@ -18,4 +18,4 @@ v::true()->validate('2'); //false
***
See also:
* [False](False.md)
* [FalseVal](FalseVal.md)

View file

@ -6,7 +6,7 @@
* [BoolType](BoolType.md)
* [CallableType](CallableType.md)
* [Date](Date.md)
* [False](False.md)
* [FalseVal](FalseVal.md)
* [Float](Float.md)
* [Instance](Instance.md)
* [Int](Int.md)
@ -214,7 +214,7 @@
* [Exists](Exists.md)
* [Extension](Extension.md)
* [Factor](Factor.md)
* [False](False.md)
* [FalseVal](FalseVal.md)
* [File](File.md)
* [FilterVar](FilterVar.md)
* [Finite](Finite.md)

View file

@ -11,7 +11,7 @@
namespace Respect\Validation\Exceptions;
class FalseException extends ValidationException
class FalseValException extends ValidationException
{
public static $defaultTemplates = array(
self::MODE_DEFAULT => array(

View file

@ -11,7 +11,7 @@
namespace Respect\Validation\Rules;
class False extends AbstractRule
class FalseVal extends AbstractRule
{
public function validate($input)
{

View file

@ -56,7 +56,7 @@ use Respect\Validation\Rules\Key;
* @method static Validator exists()
* @method static Validator extension(string $extension)
* @method static Validator factor(int $dividend)
* @method static Validator false()
* @method static Validator falseVal()
* @method static Validator file()
* @method static Validator filterVar(int $filter, mixed $options = null)
* @method static Validator finite()

View file

@ -13,17 +13,17 @@ namespace Respect\Validation\Rules;
/**
* @group rule
* @covers Respect\Validation\Rules\False
* @covers Respect\Validation\Exceptions\FalseException
* @covers Respect\Validation\Rules\FalseVal
* @covers Respect\Validation\Exceptions\FalseValException
*/
class FalseTest extends \PHPUnit_Framework_TestCase
class FalseValTest extends \PHPUnit_Framework_TestCase
{
/**
* @dataProvider validFalseProvider
*/
public function testShouldValidatePatternAccordingToTheDefinedLocale($input)
{
$rule = new False();
$rule = new FalseVal();
$this->assertTrue($rule->validate($input));
}
@ -51,7 +51,7 @@ class FalseTest extends \PHPUnit_Framework_TestCase
*/
public function testShouldNotValidatePatternAccordingToTheDefinedLocale($input)
{
$rule = new False();
$rule = new FalseVal();
$this->assertFalse($rule->validate($input));
}