mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Update unit tests base
This commit is contained in:
@@ -894,6 +894,22 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
->method('deliver')
|
||||
->with($this->isInstanceOf($expectedMail), $this->equalTo($receipt));
|
||||
}
|
||||
|
||||
protected function mockNotificationsDeliverer(array &$expectedMails)
|
||||
{
|
||||
self::$DI['app']['notification.deliverer'] = $this->getMockBuilder('Alchemy\Phrasea\Notification\Deliverer')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$phpunit = $this;
|
||||
|
||||
self::$DI['app']['notification.deliverer']->expects($this->any())
|
||||
->method('deliver')
|
||||
->will($this->returnCallback(function ($email, $receipt) use ($phpunit, &$expectedMails) {
|
||||
$phpunit->assertTrue(isset($expectedMails[get_class($email)]));
|
||||
$expectedMails[get_class($email)]++;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
class CsrfTestProvider implements CsrfProviderInterface
|
||||
|
Reference in New Issue
Block a user