You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
728 B
PHTML
27 lines
728 B
PHTML
5 years ago
|
<?php
|
||
|
|
||
|
namespace Engelsystem\Test\Unit\Http\Validation\Rules;
|
||
|
|
||
|
use Engelsystem\Http\Validation\Rules\Min;
|
||
|
use Engelsystem\Test\Unit\TestCase;
|
||
|
|
||
|
class MinTest extends TestCase
|
||
|
{
|
||
|
/**
|
||
|
* @covers \Engelsystem\Http\Validation\Rules\Min
|
||
|
*/
|
||
|
public function testValidate()
|
||
|
{
|
||
|
$rule = new Min(3);
|
||
|
$this->assertFalse($rule->validate(1));
|
||
|
$this->assertFalse($rule->validate('2'));
|
||
|
$this->assertTrue($rule->validate(3));
|
||
|
$this->assertFalse($rule->validate('AS'));
|
||
|
$this->assertTrue($rule->validate('TEST'));
|
||
|
|
||
|
$rule = new Min('2042-01-01');
|
||
|
$this->assertFalse($rule->validate('2000-01-01'));
|
||
|
$this->assertTrue($rule->validate('2345-01-01'));
|
||
|
}
|
||
|
}
|