aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-01-25 14:50:46 +0100
committerGitHub <noreply@github.com>2018-01-25 14:50:46 +0100
commit8160d0bc2aa334806e6c6e45e4f49bd9cf1a8097 (patch)
tree38a85a16e46ab97f9f8ab4afc3afbd596ce7fb24 /apps/dav
parentfe88e7f9264e3826e7efeb7144eb8ce0267cefe8 (diff)
parent4718d2b80d88170f3814d3f7795bda9557ef12ac (diff)
downloadnextcloud-server-8160d0bc2aa334806e6c6e45e4f49bd9cf1a8097.tar.gz
nextcloud-server-8160d0bc2aa334806e6c6e45e4f49bd9cf1a8097.zip
Merge pull request #8036 from nextcloud/phpunit6
Require PHPUnit 6.5 or higher
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/tests/unit/AppInfo/ApplicationTest.php2
-rw-r--r--apps/dav/tests/unit/AppInfo/PluginManagerTest.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/CalDavBackendTest.php3
-rw-r--r--apps/dav/tests/unit/CalDAV/CalendarTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php3
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php5
-rw-r--r--apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php4
-rw-r--r--apps/dav/tests/unit/bootstrap.php4
11 files changed, 18 insertions, 17 deletions
diff --git a/apps/dav/tests/unit/AppInfo/ApplicationTest.php b/apps/dav/tests/unit/AppInfo/ApplicationTest.php
index bb6cfe67b4d..d4f53d360a9 100644
--- a/apps/dav/tests/unit/AppInfo/ApplicationTest.php
+++ b/apps/dav/tests/unit/AppInfo/ApplicationTest.php
@@ -61,6 +61,6 @@ class ApplicationTest extends TestCase {
/** @var IManager|\PHPUnit_Framework_MockObject_MockObject $cm */
$cm = $this->createMock(IManager::class);
$app->setupContactsProvider($cm, 'xxx');
- $this->assertTrue(true);
+ $this->addToAssertionCount(1);
}
}
diff --git a/apps/dav/tests/unit/AppInfo/PluginManagerTest.php b/apps/dav/tests/unit/AppInfo/PluginManagerTest.php
index 89c972acd26..a4fcef92511 100644
--- a/apps/dav/tests/unit/AppInfo/PluginManagerTest.php
+++ b/apps/dav/tests/unit/AppInfo/PluginManagerTest.php
@@ -22,8 +22,8 @@
namespace OCA\DAV\Tests\unit\AppInfo;
+use OC\App\AppManager;
use Test\TestCase;
-use OCP\App\IAppManager;
use OC\ServerContainer;
use OCA\DAV\AppInfo\PluginManager;
@@ -37,7 +37,7 @@ class PluginManagerTest extends TestCase {
$server = $this->createMock(ServerContainer::class);
- $appManager = $this->createMock(IAppManager::class);
+ $appManager = $this->createMock(AppManager::class);
$appManager->method('getInstalledApps')
->willReturn(['adavapp', 'adavapp2']);
diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
index 2a01bd425c0..310433f0913 100644
--- a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
+++ b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
@@ -176,7 +176,7 @@ EOD;
protected function assertAcl($principal, $privilege, $acl) {
foreach($acl as $a) {
if ($a['principal'] === $principal && $a['privilege'] === $privilege) {
- $this->assertTrue(true);
+ $this->addToAssertionCount(1);
return;
}
}
@@ -190,7 +190,7 @@ EOD;
return;
}
}
- $this->assertTrue(true);
+ $this->addToAssertionCount(1);
}
protected function assertAccess($shouldHaveAcl, $principal, $privilege, $acl) {
diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
index 0b8978a0409..fd048240467 100644
--- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
@@ -36,6 +36,7 @@ use OCP\IL10N;
use Sabre\DAV\PropPatch;
use Sabre\DAV\Xml\Property\Href;
use Sabre\DAVACL\IACL;
+use Sabre\DAV\Exception\NotFound;
/**
* Class CalDavBackendTest
@@ -526,7 +527,7 @@ EOD;
$calendar->setPublishStatus(false);
$this->assertEquals(false, $calendar->getPublishStatus());
- $this->setExpectedException('Sabre\DAV\Exception\NotFound');
+ $this->expectException(NotFound::class);
$this->backend->getPublicCalendar($publicCalendarURI);
}
diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php
index dbdbf0dbafd..f467d46bf60 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php
@@ -183,7 +183,7 @@ class CalendarTest extends TestCase {
->with(666, $propPatch);
}
$c->propPatch($propPatch);
- $this->assertTrue(true);
+ $this->addToAssertionCount(1);
}
/**
diff --git a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php
index b2ba8ba119a..36aa4fa449b 100644
--- a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php
+++ b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php
@@ -25,8 +25,9 @@ namespace OCA\DAV\Tests\unit\CalDAV\Publishing;
use OCA\DAV\CalDAV\Publishing\Xml\Publisher;
use Sabre\Xml\Writer;
+use Test\TestCase;
-class PublisherTest extends \PHPUnit_Framework_TestCase {
+class PublisherTest extends TestCase {
const NS_CALENDARSERVER = 'http://calendarserver.org/ns/';
diff --git a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php
index cbde8c2ef68..91973eeff5d 100644
--- a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php
@@ -174,7 +174,7 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
);
// no exception, soft fail
- $this->assertTrue(true);
+ $this->addToAssertionCount(1);
}
/**
diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
index e72987ef02d..968cb548068 100644
--- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
@@ -345,7 +345,7 @@ class DirectoryTest extends \Test\TestCase {
*/
public function testMoveSuccess($source, $destination, $updatables, $deletables) {
$this->moveTest($source, $destination, $updatables, $deletables);
- $this->assertTrue(true);
+ $this->addToAssertionCount(1);
}
/**
diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
index 800bdfd3598..ea520bca7e5 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
@@ -29,6 +29,7 @@
namespace OCA\DAV\Tests\unit\Connector\Sabre;
use OC\User\User;
+use OCA\DAV\Connector\Sabre\Directory;
use OCA\DAV\Connector\Sabre\File;
use OCA\DAV\Connector\Sabre\FilesPlugin;
use OCA\DAV\Connector\Sabre\Node;
@@ -319,7 +320,7 @@ class FilesPluginTest extends TestCase {
}
public function testGetPropertiesForRootDirectory() {
- /** @var \OCA\DAV\Connector\Sabre\Directory | \PHPUnit_Framework_MockObject_MockObject $node */
+ /** @var \OCA\DAV\Connector\Sabre\Directory|\PHPUnit_Framework_MockObject_MockObject $node */
$node = $this->getMockBuilder(Directory::class)
->disableOriginalConstructor()
->getMock();
@@ -382,6 +383,8 @@ class FilesPluginTest extends TestCase {
$propFind,
$node
);
+
+ $this->addToAssertionCount(1);
}
public function testUpdateProps() {
diff --git a/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php b/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php
index 18c774883c0..b9a6efdcc22 100644
--- a/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php
+++ b/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php
@@ -251,7 +251,7 @@ class SystemTagNodeTest extends \Test\TestCase {
->method('deleteTags')
->with('1');
if (!$isAdmin) {
- $this->setExpectedException(Forbidden::class);
+ $this->expectException(Forbidden::class);
}
$this->getTagNode($isAdmin, $tag)->delete();
}
@@ -282,7 +282,7 @@ class SystemTagNodeTest extends \Test\TestCase {
$this->tagManager->expects($this->never())
->method('deleteTags');
- $this->setExpectedException($expectedException);
+ $this->expectException($expectedException);
$this->getTagNode(false, $tag)->delete();
}
diff --git a/apps/dav/tests/unit/bootstrap.php b/apps/dav/tests/unit/bootstrap.php
index 178bc695b6a..a2ad505342b 100644
--- a/apps/dav/tests/unit/bootstrap.php
+++ b/apps/dav/tests/unit/bootstrap.php
@@ -26,10 +26,6 @@ if (!defined('PHPUNIT_RUN')) {
require_once __DIR__.'/../../../../lib/base.php';
-if(!class_exists('PHPUnit_Framework_TestCase')) {
- require_once('PHPUnit/Autoload.php');
-}
-
\OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true);
\OC_App::loadApp('dav');