Files
Phraseanet/tests/Alchemy/Tests/Phrasea/Form/Constraint/NewEmailTest.php
2015-06-15 19:30:51 +02:00

37 lines
1020 B
PHP

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