mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Remove User_Adapter
This commit is contained in:
@@ -20,8 +20,8 @@ abstract class PhraseanetAuthenticatedWebTestCase extends \PhraseanetAuthenticat
|
||||
|
||||
public function setAdmin($bool)
|
||||
{
|
||||
$stubAuthenticatedUser = $this->getMockBuilder('\User_Adapter')//, array('is_admin', 'ACL'), array(self::$DI['app']['authentication']->getUser()->get_id(), self::$DI['app']))
|
||||
->setMethods(['get_id'])
|
||||
$stubAuthenticatedUser = $this->getMockBuilder('Alchemy\Phrasea\Model\Entities\User')//, array('is_admin', 'ACL'), array(self::$DI['app']['authentication']->getUser()->getId(), self::$DI['app']))
|
||||
->setMethods(array('getId'))
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
@@ -67,11 +67,11 @@ abstract class PhraseanetAuthenticatedWebTestCase extends \PhraseanetAuthenticat
|
||||
|
||||
$this->StubbedACL->expects($this->any())
|
||||
->method('get_granted_base')
|
||||
->will($this->returnValue([self::$DI['collection']]));
|
||||
->will($this->returnValue(array(self::$DI['collection'])));
|
||||
|
||||
$this->StubbedACL->expects($this->any())
|
||||
->method('get_granted_sbas')
|
||||
->will($this->returnValue([self::$DI['collection']->get_databox()]));
|
||||
->will($this->returnValue(array(self::$DI['collection']->get_databox())));
|
||||
|
||||
$aclProvider = $this->getMockBuilder('Alchemy\Phrasea\Authentication\ACLProvider')
|
||||
->disableOriginalConstructor()
|
||||
@@ -84,13 +84,13 @@ abstract class PhraseanetAuthenticatedWebTestCase extends \PhraseanetAuthenticat
|
||||
self::$DI['app']['acl'] = $aclProvider;
|
||||
|
||||
$stubAuthenticatedUser->expects($this->any())
|
||||
->method('get_id')
|
||||
->will($this->returnValue(self::$DI['user']->get_id()));
|
||||
->method('getId')
|
||||
->will($this->returnValue(self::$DI['user']->getId()));
|
||||
|
||||
self::$DI['app']['authentication']->setUser($stubAuthenticatedUser);
|
||||
|
||||
self::$DI['client'] = self::$DI->share(function ($DI) {
|
||||
return new Client($DI['app'], []);
|
||||
return new Client($DI['app'], array());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ abstract class PhraseanetAuthenticatedWebTestCase extends \PhraseanetAuthenticat
|
||||
{
|
||||
$this->createDatabase();
|
||||
|
||||
$connexion = self::$DI['app']['conf']->get(['main', 'database']);
|
||||
$connexion = self::$DI['app']['phraseanet.configuration']['main']['database'];
|
||||
|
||||
try {
|
||||
$conn = new \connection_pdo(
|
||||
@@ -162,12 +162,12 @@ abstract class PhraseanetAuthenticatedWebTestCase extends \PhraseanetAuthenticat
|
||||
|
||||
public function provideFlashMessages()
|
||||
{
|
||||
return [
|
||||
['warning', 'Be careful !'],
|
||||
['error', 'An error occured'],
|
||||
['info', 'You need to do something more'],
|
||||
['success', "Success operation !"],
|
||||
];
|
||||
return array(
|
||||
array('warning', 'Be careful !'),
|
||||
array('error', 'An error occured'),
|
||||
array('info', 'You need to do something more'),
|
||||
array('success', "Success operation !"),
|
||||
);
|
||||
}
|
||||
|
||||
protected function assertFormOrFlashError(Crawler $crawler, $quantity)
|
||||
|
Reference in New Issue
Block a user