mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Refactor tests to use $this->getApplication().
Move LoginTest specific use case into LoginTest class
This commit is contained in:
@@ -1961,4 +1961,19 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
|
||||
self::$DI['app']['registration.manager'] = $managerMock;
|
||||
self::$DI['app']['registration.manager']->expects($this->any())->method('isRegistrationEnabled')->will($this->returnValue(false));
|
||||
}
|
||||
|
||||
private function mockNotificationsDeliverer(array &$expectedMails)
|
||||
{
|
||||
$app = $this->getApplication();
|
||||
$app['notification.deliverer'] = $this->getMockBuilder('Alchemy\Phrasea\Notification\Deliverer')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$app['notification.deliverer']->expects($this->any())
|
||||
->method('deliver')
|
||||
->will($this->returnCallback(function ($email, $receipt) use (&$expectedMails) {
|
||||
$this->assertTrue(isset($expectedMails[get_class($email)]));
|
||||
$expectedMails[get_class($email)]++;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user