Files
Phraseanet/tests/Alchemy/Tests/Phrasea/Form/Constraint/NewEmailTest.php
2014-02-19 17:28:53 +01:00

33 lines
958 B
PHP

<?php
namespace Alchemy\Tests\Phrasea\Form\Constraint;
use Alchemy\Phrasea\Form\Constraint\NewEmail;
class NewEmailTest extends \PhraseanetTestCase
{
public function testAnUnknownAddressIsNotAlreadyRegistered()
{
$constraint = new NewEmail(self::$DI['app']);
$this->assertFalse($constraint->isAlreadyRegistered('nonehere'));
}
public function testARegisteredAddressIsAlreadyRegistered()
{
$constraint = new NewEmail(self::$DI['app']);
$this->assertTrue($constraint->isAlreadyRegistered(self::$DI['user']->getEmail()));
}
public function testNullIsNotAlreadyRegistered()
{
$constraint = new NewEmail(self::$DI['app']);
$this->assertFalse($constraint->isAlreadyRegistered(null));
}
public function testBlankIsNotAlreadyRegistered()
{
$constraint = new NewEmail(self::$DI['app']);
$this->assertFalse($constraint->isAlreadyRegistered(''));
}
}