mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Remove some circular references
This commit is contained in:
@@ -8,25 +8,25 @@ class NewEmailTest extends \PhraseanetTestCase
|
||||
{
|
||||
public function testAnUnknownAddressIsNotAlreadyRegistered()
|
||||
{
|
||||
$constraint = new NewEmail(self::$DI['app']);
|
||||
$constraint = NewEmail::create(self::$DI['app']);
|
||||
$this->assertFalse($constraint->isAlreadyRegistered('nonehere'));
|
||||
}
|
||||
|
||||
public function testARegisteredAddressIsAlreadyRegistered()
|
||||
{
|
||||
$constraint = new NewEmail(self::$DI['app']);
|
||||
$constraint = NewEmail::create(self::$DI['app']);
|
||||
$this->assertTrue($constraint->isAlreadyRegistered(self::$DI['user']->getEmail()));
|
||||
}
|
||||
|
||||
public function testNullIsNotAlreadyRegistered()
|
||||
{
|
||||
$constraint = new NewEmail(self::$DI['app']);
|
||||
$constraint = NewEmail::create(self::$DI['app']);
|
||||
$this->assertFalse($constraint->isAlreadyRegistered(null));
|
||||
}
|
||||
|
||||
public function testBlankIsNotAlreadyRegistered()
|
||||
{
|
||||
$constraint = new NewEmail(self::$DI['app']);
|
||||
$constraint = NewEmail::create(self::$DI['app']);
|
||||
$this->assertFalse($constraint->isAlreadyRegistered(''));
|
||||
}
|
||||
}
|
||||
|
@@ -8,25 +8,25 @@ class NewLoginTest extends \PhraseanetTestCase
|
||||
{
|
||||
public function testAnUnknownLoginIsNotAlreadyRegistered()
|
||||
{
|
||||
$constraint = new NewLogin(self::$DI['app']);
|
||||
$constraint = NewLogin::create(self::$DI['app']);
|
||||
$this->assertFalse($constraint->isAlreadyRegistered('nonehere@test.com'));
|
||||
}
|
||||
|
||||
public function testARegisteredLoginIsAlreadyRegistered()
|
||||
{
|
||||
$constraint = new NewLogin(self::$DI['app']);
|
||||
$constraint = NewLogin::create(self::$DI['app']);
|
||||
$this->assertTrue($constraint->isAlreadyRegistered(self::$DI['user']->getLogin()));
|
||||
}
|
||||
|
||||
public function testNullIsNotAlreadyRegistered()
|
||||
{
|
||||
$constraint = new NewLogin(self::$DI['app']);
|
||||
$constraint = NewLogin::create(self::$DI['app']);
|
||||
$this->assertFalse($constraint->isAlreadyRegistered(null));
|
||||
}
|
||||
|
||||
public function testBlankIsNotAlreadyRegistered()
|
||||
{
|
||||
$constraint = new NewLogin(self::$DI['app']);
|
||||
$constraint = NewLogin::create(self::$DI['app']);
|
||||
$this->assertFalse($constraint->isAlreadyRegistered(''));
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ class PasswordTokenTest extends \PhraseanetTestCase
|
||||
->with($token)
|
||||
->will($this->throwException(new NotFoundHttpException('Token not found')));
|
||||
|
||||
$constraint = new PasswordToken(self::$DI['app'], $random);
|
||||
$constraint = new PasswordToken($random);
|
||||
$this->assertFalse($constraint->isValid($token));
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class PasswordTokenTest extends \PhraseanetTestCase
|
||||
->with($token)
|
||||
->will($this->returnValue(['usr_id' => mt_rand(), 'type' => \random::TYPE_PASSWORD]));
|
||||
|
||||
$constraint = new PasswordToken(self::$DI['app'], $random);
|
||||
$constraint = new PasswordToken($random);
|
||||
$this->assertTrue($constraint->isValid($token));
|
||||
}
|
||||
}
|
||||
|
@@ -9,6 +9,6 @@ class PhraseaRecoverPasswordFormTest extends FormTestCase
|
||||
{
|
||||
protected function getForm()
|
||||
{
|
||||
return new PhraseaRecoverPasswordForm(self::$DI['app']);
|
||||
return new PhraseaRecoverPasswordForm(self::$DI['app']['tokens']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user