diff options
author | Julius Haertl <jus@bitgrid.net> | 2017-02-09 17:12:00 +0100 |
---|---|---|
committer | Julius Haertl <jus@bitgrid.net> | 2017-02-16 15:13:39 +0100 |
commit | b2cbe3530daa04451195865afc177bc6bde6c359 (patch) | |
tree | 35a9cd6e708f035c1b34bb6e79e691f5d070f5d3 /apps/theming/tests/Controller | |
parent | 88a0ef7d4a49403c0b803cd8716ae95688490b59 (diff) | |
download | nextcloud-server-b2cbe3530daa04451195865afc177bc6bde6c359.tar.gz nextcloud-server-b2cbe3530daa04451195865afc177bc6bde6c359.zip |
Use ::class in tests and correct import
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/tests/Controller')
-rw-r--r-- | apps/theming/tests/Controller/ThemingControllerTest.php | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php index 97770e7ce62..0c47ac972b7 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -24,14 +24,18 @@ */ namespace OCA\Theming\Tests\Controller; +use OC\L10N\L10N; use OCA\Theming\Controller\ThemingController; use OCA\Theming\Util; use OCP\App\IAppManager; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\Files\IAppData; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; +use OCP\Files\SimpleFS\ISimpleFile; +use OCP\Files\SimpleFS\ISimpleFolder; use OCP\IConfig; use OCP\IL10N; use OCP\IRequest; @@ -64,22 +68,22 @@ class ThemingControllerTest extends TestCase { private $appData; public function setUp() { - $this->request = $this->getMockBuilder('OCP\IRequest')->getMock(); - $this->config = $this->getMockBuilder('OCP\IConfig')->getMock(); - $this->template = $this->getMockBuilder('OCA\Theming\ThemingDefaults') + $this->request = $this->getMockBuilder(IRequest::class)->getMock(); + $this->config = $this->getMockBuilder(IConfig::class)->getMock(); + $this->template = $this->getMockBuilder(ThemingDefaults::class) ->disableOriginalConstructor()->getMock(); - $this->timeFactory = $this->getMockBuilder('OCP\AppFramework\Utility\ITimeFactory') + $this->timeFactory = $this->getMockBuilder(ITimeFactory::class) ->disableOriginalConstructor() ->getMock(); - $this->l10n = $this->getMockBuilder('OCP\IL10N')->getMock(); - $this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder')->getMock(); - $this->appManager = $this->getMockBuilder('OCP\App\IAppManager')->getMock(); + $this->l10n = $this->getMockBuilder(L10N::class)->getMock(); + $this->rootFolder = $this->getMockBuilder(IRootFolder::class)->getMock(); + $this->appManager = $this->getMockBuilder(IAppManager::class)->getMock(); $this->util = new Util($this->config, $this->rootFolder, $this->appManager); $this->timeFactory->expects($this->any()) ->method('getTime') ->willReturn(123); $this->tempManager = \OC::$server->getTempManager(); - $this->appData = $this->getMockBuilder('OCP\Files\IAppData')->getMock(); + $this->appData = $this->getMockBuilder(IAppData::class)->getMock(); $this->themingController = new ThemingController( 'theming', @@ -196,10 +200,10 @@ class ThemingControllerTest extends TestCase { ->willReturn('Saved'); - $file = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFile') + $file = $this->getMockBuilder(ISimpleFile::class) ->disableOriginalConstructor() ->getMock(); - $folder = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFolder') + $folder = $this->getMockBuilder(ISimpleFolder::class) ->disableOriginalConstructor() ->getMock(); $this->appData @@ -251,10 +255,10 @@ class ThemingControllerTest extends TestCase { ->with('Saved') ->willReturn('Saved'); - $file = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFile') + $file = $this->getMockBuilder(ISimpleFile::class) ->disableOriginalConstructor() ->getMock(); - $folder = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFolder') + $folder = $this->getMockBuilder(ISimpleFolder::class) ->disableOriginalConstructor() ->getMock(); $this->appData @@ -305,7 +309,7 @@ class ThemingControllerTest extends TestCase { ->with('Unsupported image type') ->willReturn('Unsupported image type'); - $folder = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFolder') + $folder = $this->getMockBuilder(ISimpleFolder::class) ->disableOriginalConstructor() ->getMock(); $this->appData @@ -362,10 +366,10 @@ class ThemingControllerTest extends TestCase { } public function testGetLogo() { - $file = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFile') + $file = $this->getMockBuilder(ISimpleFile::class) ->disableOriginalConstructor() ->getMock(); - $folder = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFolder') + $folder = $this->getMockBuilder(ISimpleFolder::class) ->disableOriginalConstructor() ->getMock(); $this->appData @@ -405,10 +409,10 @@ class ThemingControllerTest extends TestCase { } public function testGetLoginBackground() { - $file = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFile') + $file = $this->getMockBuilder(ISimpleFile::class) ->disableOriginalConstructor() ->getMock(); - $folder = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFolder') + $folder = $this->getMockBuilder(ISimpleFolder::class) ->disableOriginalConstructor() ->getMock(); $this->appData |