diff options
author | Thomas Citharel <tcit@tcit.fr> | 2016-07-31 20:18:35 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-09-26 11:55:39 +0200 |
commit | 3921385ed3994c26674ec31606a41899fa8648ee (patch) | |
tree | b5ace47668519e029a342f26e936056d790836c5 /apps/dav/tests/unit | |
parent | ebf23778f5a71b421021165627738e6e7ed5216f (diff) | |
download | nextcloud-server-3921385ed3994c26674ec31606a41899fa8648ee.tar.gz nextcloud-server-3921385ed3994c26674ec31606a41899fa8648ee.zip |
fix things (indentation, tests, comments, backend custom implementation
Diffstat (limited to 'apps/dav/tests/unit')
3 files changed, 12 insertions, 12 deletions
diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php index 0e2e1b0ee51..ebdd4d9f940 100644 --- a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php @@ -75,7 +75,8 @@ abstract class AbstractCalDavBackendTest extends TestCase { ->willReturn([self::UNIT_TEST_GROUP]); $db = \OC::$server->getDatabaseConnection(); - $this->backend = new CalDavBackend($db, $this->principal, $this->userManager); + $config = \OC::$server->getConfig(); + $this->backend = new CalDavBackend($db, $this->principal, $this->userManager, $config); $this->tearDown(); } diff --git a/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php b/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php index b3ff36fc4ed..69de507dac5 100644 --- a/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php +++ b/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php @@ -4,7 +4,6 @@ namespace OCA\DAV\Tests\unit\CalDAV\Publishing; 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; @@ -30,16 +29,16 @@ class PluginTest extends TestCase { public function setUp() { parent::setUp(); - /** @var Auth | \PHPUnit_Framework_MockObject_MockObject $authBackend */ - $authBackend = $this->getMockBuilder('OCA\DAV\DAV\PublicAuth')->disableOriginalConstructor()->getMock(); - $authBackend->method('isDavAuthenticated')->willReturn(true); - - $this->config = $this->getMock('\OCP\IConfig'); + $this->config = $this->getMockBuilder('\OCP\IConfig')-> + disableOriginalConstructor()-> + getMock(); $this->config->expects($this->any())->method('getSystemValue') ->with($this->equalTo('secret')) ->willReturn('mysecret'); - $this->urlGenerator = $this->getMock('OCP\IURLGenerator'); + $this->urlGenerator = $this->getMockBuilder('OCP\IURLGenerator')-> + disableOriginalConstructor()-> + getMock(); /** @var IRequest $request */ $this->plugin = new PublishPlugin($this->config, $this->urlGenerator); @@ -48,8 +47,8 @@ class PluginTest extends TestCase { $this->server = new Server($root); /** @var SimpleCollection $node */ $this->book = $this->getMockBuilder('OCA\DAV\CalDAV\Calendar')-> - disableOriginalConstructor()-> - getMock(); + disableOriginalConstructor()-> + getMock(); $this->book->method('getName')->willReturn('cal1'); $root->addChild($this->book); $this->plugin->initialize($this->server); diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php index 07a55fef63b..e2d63868af0 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php @@ -471,7 +471,7 @@ class FilesPluginTest extends TestCase { $node = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Node') ->disableOriginalConstructor() ->getMock(); - $node->expects($this->at(0)) + $node->expects($this->once()) ->method('getFileInfo') ->willReturn($fileInfoFolderATestTXT); @@ -545,7 +545,7 @@ class FilesPluginTest extends TestCase { ->getMock(); $request - ->expects($this->at(1)) + ->expects($this->once()) ->method('getPath') ->will($this->returnValue('test/somefile.xml')); |