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

37 lines
1.0 KiB
PHP

<?php
namespace Alchemy\Tests\Phrasea\Form\Constraint;
use Alchemy\Phrasea\Form\Constraint\NewLogin;
/**
* @group functional
* @group legacy
*/
class NewLoginTest extends \PhraseanetTestCase
{
public function testAnUnknownLoginIsNotAlreadyRegistered()
{
$constraint = NewLogin::create(self::$DI['app']);
$this->assertFalse($constraint->isAlreadyRegistered('nonehere@test.com'));
}
public function testARegisteredLoginIsAlreadyRegistered()
{
$constraint = NewLogin::create(self::$DI['app']);
$this->assertTrue($constraint->isAlreadyRegistered(self::$DI['user']->getLogin()));
}
public function testNullIsNotAlreadyRegistered()
{
$constraint = NewLogin::create(self::$DI['app']);
$this->assertFalse($constraint->isAlreadyRegistered(null));
}
public function testBlankIsNotAlreadyRegistered()
{
$constraint = NewLogin::create(self::$DI['app']);
$this->assertFalse($constraint->isAlreadyRegistered(''));
}
}