summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-07-20 14:26:24 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-09-26 11:55:38 +0200
commitde5e21269462957894e62b677d389862bb647d09 (patch)
tree1cb0cde67c19bac49a196010a7290a186d2989c1 /apps/dav/tests
parent77216e7ca97e763ab12d30c471d0a73b44faeeba (diff)
downloadnextcloud-server-de5e21269462957894e62b677d389862bb647d09.tar.gz
nextcloud-server-de5e21269462957894e62b677d389862bb647d09.zip
fix plugin test
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php b/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php
index 00e4f049307..43345a34889 100644
--- a/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php
+++ b/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php
@@ -6,6 +6,8 @@ use OCA\DAV\CalDAV\Calendar;
use OCA\DAV\CalDAV\Publishing\PublishPlugin;
use OCA\DAV\Connector\Sabre\Auth;
use OCP\IRequest;
+use OCP\IURLGenerator;
+use OCP\IConfig;
use Sabre\DAV\Server;
use Sabre\DAV\SimpleCollection;
use Sabre\HTTP\Request;
@@ -14,12 +16,16 @@ use Test\TestCase;
class PluginTest extends TestCase {
- /** @var Plugin */
+ /** @var PublishPlugin */
private $plugin;
/** @var Server */
private $server;
/** @var Calendar | \PHPUnit_Framework_MockObject_MockObject */
private $book;
+ /** @var IConfig | \PHPUnit_Framework_MockObject_MockObject */
+ private $config;
+ /** @var IURLGenerator | \PHPUnit_Framework_MockObject_MockObject */
+ private $urlGenerator;
public function setUp() {
parent::setUp();
@@ -28,9 +34,15 @@ class PluginTest extends TestCase {
$authBackend = $this->getMockBuilder('OCA\DAV\DAV\PublicAuth')->disableOriginalConstructor()->getMock();
$authBackend->method('isDavAuthenticated')->willReturn(true);
+ $this->config = $this->getMock('\OCP\IConfig');
+ $this->config->expects($this->any())->method('getSystemValue')
+ ->with($this->equalTo('secret'))
+ ->willReturn('mysecret');
+
+ $this->urlGenerator = $this->getMock('OCP\IURLGenerator');
+
/** @var IRequest $request */
- $request = $this->getMockBuilder('OCP\IRequest')->disableOriginalConstructor()->getMock();
- $this->plugin = new PublishPlugin($authBackend, $request);
+ $this->plugin = new PublishPlugin($this->config, $this->urlGenerator);
$root = new SimpleCollection('calendars');
$this->server = new Server($root);