Files
Phraseanet/tests/Alchemy/Tests/Phrasea/Form/Constraint/NewEmailTest.php
Romain Neutron 58df66b68b Fix typo
2013-05-29 14:23:19 +02:00

33 lines
966 B
PHP

<?php
namespace Alchemy\Tests\Phrasea\Form\Constraint;
use Alchemy\Phrasea\Form\Constraint\NewEmail;
class NewEmailTest extends \PhraseanetPHPUnitAbstract
{
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']->get_email()));
}
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(''));
}
}