mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
33 lines
958 B
PHP
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(''));
|
|
}
|
|
}
|