mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
33 lines
964 B
PHP
33 lines
964 B
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\Form\Constraint;
|
|
|
|
use Alchemy\Phrasea\Form\Constraint\NewLogin;
|
|
|
|
class NewLoginTest extends \PhraseanetTestCase
|
|
{
|
|
public function testAnUnknownLoginIsNotAlreadyRegistered()
|
|
{
|
|
$constraint = new NewLogin(self::$DI['app']);
|
|
$this->assertFalse($constraint->isAlreadyRegistered('nonehere@test.com'));
|
|
}
|
|
|
|
public function testARegisteredLoginIsAlreadyRegistered()
|
|
{
|
|
$constraint = new NewLogin(self::$DI['app']);
|
|
$this->assertTrue($constraint->isAlreadyRegistered(self::$DI['user']->get_login()));
|
|
}
|
|
|
|
public function testNullIsNotAlreadyRegistered()
|
|
{
|
|
$constraint = new NewLogin(self::$DI['app']);
|
|
$this->assertFalse($constraint->isAlreadyRegistered(null));
|
|
}
|
|
|
|
public function testBlankIsNotAlreadyRegistered()
|
|
{
|
|
$constraint = new NewLogin(self::$DI['app']);
|
|
$this->assertFalse($constraint->isAlreadyRegistered(''));
|
|
}
|
|
}
|