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