diff options
author | Daniel Opitz <git@copynpaste.de> | 2018-10-16 22:37:48 +0200 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2018-12-04 17:10:46 +0100 |
commit | e158cc1d3b1fb33de5aaa1aaac0c7828016fb7b9 (patch) | |
tree | 4d3b4da643a428f259ca9fe1c63d97f8cecfb5fc /tests/Unit/Controller/ItemApiControllerTest.php | |
parent | 5c7fdb08534018ba86ec4a38f45b63cbbf67a72f (diff) |
use magic class constant instead of classname strings
Diffstat (limited to 'tests/Unit/Controller/ItemApiControllerTest.php')
-rw-r--r-- | tests/Unit/Controller/ItemApiControllerTest.php | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/Unit/Controller/ItemApiControllerTest.php b/tests/Unit/Controller/ItemApiControllerTest.php index 1e6fde59b..5733a0c87 100644 --- a/tests/Unit/Controller/ItemApiControllerTest.php +++ b/tests/Unit/Controller/ItemApiControllerTest.php @@ -16,10 +16,14 @@ namespace OCA\News\Tests\Unit\Controller; use OCA\News\Controller\ItemApiController; +use OCA\News\Service\ItemService; use \OCP\AppFramework\Http; use \OCA\News\Service\ServiceNotFoundException; use \OCA\News\Db\Item; +use OCP\IRequest; +use OCP\IUser; +use OCP\IUserSession; use PHPUnit\Framework\TestCase; @@ -39,19 +43,13 @@ class ItemApiControllerTest extends TestCase { $this->user = 'tom'; $this->appName = 'news'; - $this->request = $this->getMockBuilder( - '\OCP\IRequest' - ) + $this->request = $this->getMockBuilder(IRequest::class) ->disableOriginalConstructor() ->getMock(); - $this->userSession = $this->getMockBuilder( - '\OCP\IUserSession' - ) + $this->userSession = $this->getMockBuilder(IUserSession::class) ->disableOriginalConstructor() ->getMock(); - $this->user = $this->getMockBuilder( - '\OCP\IUser' - ) + $this->user = $this->getMockBuilder(IUser::class) ->disableOriginalConstructor() ->getMock(); $this->userSession->expects($this->any()) @@ -60,9 +58,7 @@ class ItemApiControllerTest extends TestCase $this->user->expects($this->any()) ->method('getUID') ->will($this->returnValue('123')); - $this->itemService = $this->getMockBuilder( - '\OCA\News\Service\ItemService' - ) + $this->itemService = $this->getMockBuilder(ItemService::class) ->disableOriginalConstructor() ->getMock(); $this->itemAPI = new ItemApiController( |