From 3a7cf40aaa678bea1df143d2982d603b7a334eec Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 27 Nov 2019 15:27:18 +0100 Subject: Mode to modern phpunit Signed-off-by: Roeland Jago Douma --- apps/theming/tests/Controller/IconControllerTest.php | 2 +- apps/theming/tests/Controller/ThemingControllerTest.php | 2 +- apps/theming/tests/ImageManagerTest.php | 12 ++++++------ apps/theming/tests/Settings/AdminTest.php | 2 +- apps/theming/tests/Settings/SectionTest.php | 2 +- apps/theming/tests/ThemingDefaultsTest.php | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'apps/theming/tests') diff --git a/apps/theming/tests/Controller/IconControllerTest.php b/apps/theming/tests/Controller/IconControllerTest.php index df0fdd52b3f..9d5970fd384 100644 --- a/apps/theming/tests/Controller/IconControllerTest.php +++ b/apps/theming/tests/Controller/IconControllerTest.php @@ -61,7 +61,7 @@ class IconControllerTest extends TestCase { /** @var ImageManager */ private $imageManager; - public function setUp(): void { + protected function setUp(): void { $this->request = $this->createMock(IRequest::class); $this->themingDefaults = $this->createMock(ThemingDefaults::class); $this->iconBuilder = $this->createMock(IconBuilder::class); diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php index a626fdebe6d..8d4650e68b3 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -83,7 +83,7 @@ class ThemingControllerTest extends TestCase { /** @var IURLGenerator */ private $urlGenerator; - public function setUp(): void { + protected function setUp(): void { $this->request = $this->createMock(IRequest::class); $this->config = $this->createMock(IConfig::class); $this->themingDefaults = $this->createMock(ThemingDefaults::class); diff --git a/apps/theming/tests/ImageManagerTest.php b/apps/theming/tests/ImageManagerTest.php index 56fa63bea7b..7d61b80efdf 100644 --- a/apps/theming/tests/ImageManagerTest.php +++ b/apps/theming/tests/ImageManagerTest.php @@ -184,10 +184,10 @@ class ImageManagerTest extends TestCase { $this->assertEquals($file, $this->imageManager->getImage('logo', false)); } - /** - * @expectedException OCP\Files\NotFoundException - */ + public function testGetImageUnset() { + $this->expectException(\OCP\Files\NotFoundException::class); + $this->config->expects($this->once()) ->method('getAppValue')->with('theming', 'logoMime', false) ->willReturn(false); @@ -239,10 +239,10 @@ class ImageManagerTest extends TestCase { $this->assertEquals($expected, $this->imageManager->getCachedImage('filename')); } - /** - * @expectedException \OCP\Files\NotFoundException - */ + public function testGetCachedImageNotFound() { + $this->expectException(\OCP\Files\NotFoundException::class); + $folder = $this->setupCacheFolder(); $folder->expects($this->once()) ->method('getFile') diff --git a/apps/theming/tests/Settings/AdminTest.php b/apps/theming/tests/Settings/AdminTest.php index 4e89366c3f2..50d0e454445 100644 --- a/apps/theming/tests/Settings/AdminTest.php +++ b/apps/theming/tests/Settings/AdminTest.php @@ -50,7 +50,7 @@ class AdminTest extends TestCase { /** @var IL10N */ private $l10n; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); $this->l10n = $this->createMock(IL10N::class); diff --git a/apps/theming/tests/Settings/SectionTest.php b/apps/theming/tests/Settings/SectionTest.php index 10d6bb172f2..dff2df3502a 100644 --- a/apps/theming/tests/Settings/SectionTest.php +++ b/apps/theming/tests/Settings/SectionTest.php @@ -37,7 +37,7 @@ class SectionTest extends TestCase { /** @var Section */ private $section; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->url = $this->createMock(IURLGenerator::class); $this->l = $this->createMock(IL10N::class); diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php index b7413eaf47d..20c80211b8d 100644 --- a/apps/theming/tests/ThemingDefaultsTest.php +++ b/apps/theming/tests/ThemingDefaultsTest.php @@ -72,7 +72,7 @@ class ThemingDefaultsTest extends TestCase { /** @var INavigationManager|\PHPUnit_Framework_MockObject_MockObject */ private $navigationManager; - public function setUp(): void { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); $this->l10n = $this->createMock(IL10N::class); -- cgit v1.2.3