miniflux-legacy/vendor/fguillot/simple-validator/tests/NotEqualsValidator.php

33 lines
1.3 KiB
PHP
Raw Normal View History

2015-01-28 02:13:16 +01:00
<?php
use SimpleValidator\Validators\NotEquals;
class EmailValidatorTest extends PHPUnit_Framework_TestCase
{
public function testValidator()
{
$message = 'should not be equal';
$v = new NotEquals('toto', 'titi', $message);
$this->assertEquals($message, $v->getErrorMessage());
$this->assertFalse($v->execute(array('toto' => 'test', 'titi' => 'test')));
$this->assertTrue($v->execute(array('toto' => 'test', 'titi' => 'testest')));
$this->assertTrue($v->execute(array('toto' => 'test')));
$this->assertTrue($v->execute(array('toto' => 'test', 'titi' => '')));
$this->assertTrue($v->execute(array('toto' => 'test', 'titi' => null)));
$this->assertTrue($v->execute(array('toto' => 'test')));
$this->assertTrue($v->execute(array('toto' => '', 'titi' => 'test')));
$this->assertTrue($v->execute(array('toto' => null, 'titi' => 'test')));
$this->assertTrue($v->execute(array('titi' => 'test')));
$this->assertTrue($v->execute(array()));
$this->assertTrue($v->execute(array('toto' => '')));
$this->assertTrue($v->execute(array('toto' => null)));
$this->assertTrue($v->execute(array('titi' => '')));
$this->assertTrue($v->execute(array('titi' => null)));
}
2015-04-11 02:34:48 +02:00
}