Fix PasswordToken constraint

This commit is contained in:
Romain Neutron
2013-05-03 01:25:48 +02:00
parent 96a0a14552
commit 993b219cc1
4 changed files with 7 additions and 7 deletions

View File

@@ -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);

View File

@@ -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'));
}