Mock AclProvider in pimple AND Application.

fix CamelCase in `stubbedACL` name.
This commit is contained in:
Benoît Burnichon
2015-07-01 11:15:53 +02:00
parent d645b92afa
commit 19b8d41dcd
5 changed files with 58 additions and 70 deletions

View File

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