mirror of
https://github.com/Respect/Validation.git
synced 2026-03-15 23:05:45 +01:00
49 lines
1 KiB
PHP
49 lines
1 KiB
PHP
<?php
|
|
namespace Respect\Validation\Rules;
|
|
|
|
class FalseTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
/**
|
|
* @dataProvider validFalseProvider
|
|
*/
|
|
public function testShouldValidatePatternAccordingToTheDefinedLocale($input)
|
|
{
|
|
$rule = new False();
|
|
|
|
$this->assertTrue($rule->validate($input));
|
|
}
|
|
|
|
public function validFalseProvider()
|
|
{
|
|
return array(
|
|
array(false),
|
|
array(0),
|
|
array('0'),
|
|
array('false'),
|
|
array('off'),
|
|
array('no'),
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @dataProvider invalidFalseProvider
|
|
*/
|
|
public function testShouldNotValidatePatternAccordingToTheDefinedLocale($input)
|
|
{
|
|
$rule = new False();
|
|
|
|
$this->assertFalse($rule->validate($input));
|
|
}
|
|
|
|
public function invalidFalseProvider()
|
|
{
|
|
return array(
|
|
array(true),
|
|
array(1),
|
|
array('1'),
|
|
array('true'),
|
|
array('on'),
|
|
array('yes'),
|
|
);
|
|
}
|
|
}
|