aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-01-24 18:10:16 +0100
committerJoas Schilling <coding@schilljs.com>2018-01-24 18:10:16 +0100
commit870023365c928e6bc3bd39d0d7f9b4d976dad33e (patch)
tree74c1438392d2101c154a80d4f4b9d4777c77bd1a /apps
parentc3424df1f026854ed8adbfdf8d96da7a6562a8dd (diff)
downloadnextcloud-server-870023365c928e6bc3bd39d0d7f9b4d976dad33e.tar.gz
nextcloud-server-870023365c928e6bc3bd39d0d7f9b4d976dad33e.zip
Fix "Undefined method setExpectedException()"
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/tests/unit/AppInfo/PluginManagerTest.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/CalDavBackendTest.php3
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php3
-rw-r--r--apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php4
-rw-r--r--apps/theming/tests/IconBuilderTest.php13
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php2
6 files changed, 13 insertions, 16 deletions
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/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/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
index 800bdfd3598..e1c4bc05dc1 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();
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/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php
index 4f5078d4c56..a2a330a2f24 100644
--- a/apps/theming/tests/IconBuilderTest.php
+++ b/apps/theming/tests/IconBuilderTest.php
@@ -34,6 +34,7 @@ use OCP\Files\IAppData;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\IConfig;
+use PHPUnit\Framework\Error\Warning;
use Test\TestCase;
class IconBuilderTest extends TestCase {
@@ -172,11 +173,9 @@ class IconBuilderTest extends TestCase {
// cloud be something like $expectedIcon->compareImages($icon, Imagick::METRIC_MEANABSOLUTEERROR)[1])
}
- /**
- * @expectedException \PHPUnit_Framework_Error_Warning
- */
public function testGetFaviconNotFound() {
$this->checkImagick();
+ $this->expectException(Warning::class);
$util = $this->getMockBuilder(Util::class)->disableOriginalConstructor()->getMock();
$iconBuilder = new IconBuilder($this->themingDefaults, $util);
$this->themingDefaults->expects($this->once())
@@ -188,11 +187,9 @@ class IconBuilderTest extends TestCase {
$this->assertFalse($iconBuilder->getFavicon('noapp'));
}
- /**
- * @expectedException \PHPUnit_Framework_Error_Warning
- */
public function testGetTouchIconNotFound() {
$this->checkImagick();
+ $this->expectException(Warning::class);
$util = $this->getMockBuilder(Util::class)->disableOriginalConstructor()->getMock();
$iconBuilder = new IconBuilder($this->themingDefaults, $util);
$util->expects($this->once())
@@ -201,11 +198,9 @@ class IconBuilderTest extends TestCase {
$this->assertFalse($iconBuilder->getTouchIcon('noapp'));
}
- /**
- * @expectedException \PHPUnit_Framework_Error_Warning
- */
public function testColorSvgNotFound() {
$this->checkImagick();
+ $this->expectException(Warning::class);
$util = $this->getMockBuilder(Util::class)->disableOriginalConstructor()->getMock();
$iconBuilder = new IconBuilder($this->themingDefaults, $util);
$util->expects($this->once())
diff --git a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
index a56098556e5..17d332691d2 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
@@ -62,7 +62,7 @@ class ProviderTest extends TestCase {
$event->expects($this->once())
->method('getApp')
->willReturn('comments');
- $this->setExpectedException(InvalidArgumentException::class);
+ $this->expectException(InvalidArgumentException::class);
$this->provider->parse($lang, $event);
}