Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
1ea356cd6a
commit
29f1ea2fbe
|
@ -30,7 +30,9 @@ use OCA\DAV\Connector\Sabre\Principal;
|
||||||
use OCP\IGroupManager;
|
use OCP\IGroupManager;
|
||||||
use OCP\ILogger;
|
use OCP\ILogger;
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
|
use OCP\IUserSession;
|
||||||
use OCP\Security\ISecureRandom;
|
use OCP\Security\ISecureRandom;
|
||||||
|
use OCP\Share\IManager as ShareManager;
|
||||||
use Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet;
|
use Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
use Test\TestCase;
|
use Test\TestCase;
|
||||||
|
@ -73,7 +75,12 @@ abstract class AbstractCalDavBackend extends TestCase {
|
||||||
$this->groupManager = $this->createMock(IGroupManager::class);
|
$this->groupManager = $this->createMock(IGroupManager::class);
|
||||||
$this->dispatcher = $this->createMock(EventDispatcherInterface::class);
|
$this->dispatcher = $this->createMock(EventDispatcherInterface::class);
|
||||||
$this->principal = $this->getMockBuilder(Principal::class)
|
$this->principal = $this->getMockBuilder(Principal::class)
|
||||||
->disableOriginalConstructor()
|
->setConstructorArgs([
|
||||||
|
$this->userManager,
|
||||||
|
$this->groupManager,
|
||||||
|
$this->createMock(ShareManager::class),
|
||||||
|
$this->createMock(IUserSession::class),
|
||||||
|
])
|
||||||
->setMethods(['getPrincipalByPath', 'getGroupMembership'])
|
->setMethods(['getPrincipalByPath', 'getGroupMembership'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$this->principal->expects($this->any())->method('getPrincipalByPath')
|
$this->principal->expects($this->any())->method('getPrincipalByPath')
|
||||||
|
|
|
@ -40,6 +40,8 @@ use OCP\IDBConnection;
|
||||||
use OCP\IGroupManager;
|
use OCP\IGroupManager;
|
||||||
use OCP\IL10N;
|
use OCP\IL10N;
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
|
use OCP\IUserSession;
|
||||||
|
use OCP\Share\IManager as ShareManager;
|
||||||
use Sabre\DAV\PropPatch;
|
use Sabre\DAV\PropPatch;
|
||||||
use Sabre\VObject\Component\VCard;
|
use Sabre\VObject\Component\VCard;
|
||||||
use Sabre\VObject\Property\Text;
|
use Sabre\VObject\Property\Text;
|
||||||
|
@ -90,7 +92,12 @@ class CardDavBackendTest extends TestCase {
|
||||||
$this->userManager = $this->createMock(IUserManager::class);
|
$this->userManager = $this->createMock(IUserManager::class);
|
||||||
$this->groupManager = $this->createMock(IGroupManager::class);
|
$this->groupManager = $this->createMock(IGroupManager::class);
|
||||||
$this->principal = $this->getMockBuilder(Principal::class)
|
$this->principal = $this->getMockBuilder(Principal::class)
|
||||||
->disableOriginalConstructor()
|
->setConstructorArgs([
|
||||||
|
$this->userManager,
|
||||||
|
$this->groupManager,
|
||||||
|
$this->createMock(ShareManager::class),
|
||||||
|
$this->createMock(IUserSession::class),
|
||||||
|
])
|
||||||
->setMethods(['getPrincipalByPath', 'getGroupMembership'])
|
->setMethods(['getPrincipalByPath', 'getGroupMembership'])
|
||||||
->getMock();
|
->getMock();
|
||||||
$this->principal->method('getPrincipalByPath')
|
$this->principal->method('getPrincipalByPath')
|
||||||
|
|
Loading…
Reference in New Issue