mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Mock AclProvider in pimple AND Application.
fix CamelCase in `stubbedACL` name.
This commit is contained in:
@@ -44,9 +44,7 @@ class record_adapterTest extends \PhraseanetAuthenticatedTestCase
|
||||
*/
|
||||
public function testSetExport()
|
||||
{
|
||||
$acl = $this->getMockBuilder('ACL')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$acl = $this->stubACL();
|
||||
$acl->expects($this->any())
|
||||
->method('has_right')
|
||||
->with($this->equalTo('order'))
|
||||
@@ -64,15 +62,6 @@ class record_adapterTest extends \PhraseanetAuthenticatedTestCase
|
||||
->with($this->isType(\PHPUnit_Framework_Constraint_IsType::TYPE_INT), $this->equalTo('cancmd'))
|
||||
->will($this->returnValue(true));
|
||||
|
||||
$aclProvider = $this->getMockBuilder('Alchemy\Phrasea\Authentication\ACLProvider')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$aclProvider->expects($this->any())
|
||||
->method('get')
|
||||
->will($this->returnValue($acl));
|
||||
|
||||
self::$DI['app']['acl'] = $aclProvider;
|
||||
|
||||
self::$DI['app']['phraseanet.user-query'] = $this->getMockBuilder('\User_Query')->disableOriginalConstructor()->getMock();
|
||||
self::$DI['app']['phraseanet.user-query']->expects($this->any())->method('get_results')->will($this->returnValue(new ArrayCollection([self::$DI['user_alt2']])));
|
||||
self::$DI['app']['phraseanet.user-query']->expects($this->any())->method('on_base_ids')->will($this->returnSelf());
|
||||
|
Reference in New Issue
Block a user