mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
Fix PasswordToken constraint
This commit is contained in:
@@ -19,7 +19,7 @@ class PasswordTokenTest extends \PhraseanetPHPUnitAbstract
|
||||
$random
|
||||
->expects($this->once())
|
||||
->method('helloToken')
|
||||
->with(self::$DI['app'], $token)
|
||||
->with($token)
|
||||
->will($this->throwException(new \Exception_NotFound('Token not found')));
|
||||
|
||||
$constraint = new PasswordToken(self::$DI['app'], $random);
|
||||
@@ -39,7 +39,7 @@ class PasswordTokenTest extends \PhraseanetPHPUnitAbstract
|
||||
$random
|
||||
->expects($this->once())
|
||||
->method('helloToken')
|
||||
->with(self::$DI['app'], $token)
|
||||
->with($token)
|
||||
->will($this->returnValue(array('usr_id' => mt_rand(), 'type' => \random::TYPE_PASSWORD)));
|
||||
|
||||
$constraint = new PasswordToken(self::$DI['app'], $random);
|
||||
|
@@ -13,10 +13,10 @@ class PasswordTokenValidatorTest extends \PhraseanetPHPUnitAbstract
|
||||
{
|
||||
$context = $this->getMock('Symfony\Component\Validator\ExecutionContextInterface');
|
||||
$builder = $context
|
||||
->expects($this->exactly($isValid ? 1 : 0))
|
||||
->expects($this->exactly($isValid ? 0 : 1))
|
||||
->method('addViolation');
|
||||
|
||||
if ($isValid) {
|
||||
if (!$isValid) {
|
||||
$builder->with($this->isType('string'));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user