diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-10-24 15:26:53 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-10-24 17:45:32 +0200 |
commit | 43e498844e8c1aa519a19238d2cf3d6b95e1aab0 (patch) | |
tree | 59510ef2ffc6c1fd1fd92475013b108f1da2bfeb /apps/files_external/tests/Service | |
parent | b1f77aca4effec99387481a831910d4870ae2ffc (diff) | |
download | nextcloud-server-43e498844e8c1aa519a19238d2cf3d6b95e1aab0.tar.gz nextcloud-server-43e498844e8c1aa519a19238d2cf3d6b95e1aab0.zip |
Use ::class in test mocks
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_external/tests/Service')
-rw-r--r-- | apps/files_external/tests/Service/BackendServiceTest.php | 10 | ||||
-rw-r--r-- | apps/files_external/tests/Service/StoragesServiceTest.php | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/apps/files_external/tests/Service/BackendServiceTest.php b/apps/files_external/tests/Service/BackendServiceTest.php index cbb25579e11..6916d47a02a 100644 --- a/apps/files_external/tests/Service/BackendServiceTest.php +++ b/apps/files_external/tests/Service/BackendServiceTest.php @@ -21,6 +21,8 @@ */ namespace OCA\Files_External\Tests\Service; +use OCA\Files_External\Lib\Auth\AuthMechanism; +use OCA\Files_External\Lib\Backend\Backend; use OCA\Files_External\Lib\Config\IAuthMechanismProvider; use OCA\Files_External\Lib\Config\IBackendProvider; use \OCA\Files_External\Service\BackendService; @@ -46,7 +48,7 @@ class BackendServiceTest extends \Test\TestCase { * @return \OCA\Files_External\Lib\Backend\Backend */ protected function getBackendMock($class) { - $backend = $this->getMockBuilder('\OCA\Files_External\Lib\Backend\Backend') + $backend = $this->getMockBuilder(Backend::class) ->disableOriginalConstructor() ->getMock(); $backend->method('getIdentifier')->will($this->returnValue('identifier:'.$class)); @@ -60,7 +62,7 @@ class BackendServiceTest extends \Test\TestCase { * @return \OCA\Files_External\Lib\Auth\AuthMechanism */ protected function getAuthMechanismMock($class) { - $backend = $this->getMockBuilder('\OCA\Files_External\Lib\Auth\AuthMechanism') + $backend = $this->getMockBuilder(AuthMechanism::class) ->disableOriginalConstructor() ->getMock(); $backend->method('getIdentifier')->will($this->returnValue('identifier:'.$class)); @@ -73,7 +75,7 @@ class BackendServiceTest extends \Test\TestCase { $backend = $this->getBackendMock('\Foo\Bar'); - $backendAlias = $this->getMockBuilder('\OCA\Files_External\Lib\Backend\Backend') + $backendAlias = $this->getMockBuilder(Backend::class) ->disableOriginalConstructor() ->getMock(); $backendAlias->method('getIdentifierAliases') @@ -175,7 +177,7 @@ class BackendServiceTest extends \Test\TestCase { ->method('removeVisibility') ->with(BackendService::VISIBILITY_PERSONAL); - $backendAlias = $this->getMockBuilder('\OCA\Files_External\Lib\Backend\Backend') + $backendAlias = $this->getMockBuilder(Backend::class) ->disableOriginalConstructor() ->getMock(); $backendAlias->method('getIdentifierAliases') diff --git a/apps/files_external/tests/Service/StoragesServiceTest.php b/apps/files_external/tests/Service/StoragesServiceTest.php index 056a03d24c8..22409ea9dbd 100644 --- a/apps/files_external/tests/Service/StoragesServiceTest.php +++ b/apps/files_external/tests/Service/StoragesServiceTest.php @@ -27,7 +27,9 @@ namespace OCA\Files_External\Tests\Service; use \OC\Files\Filesystem; +use OCA\Files_External\Lib\Auth\AuthMechanism; use OCA\Files_External\Lib\Auth\InvalidAuth; +use OCA\Files_External\Lib\Backend\Backend; use OCA\Files_External\Lib\Backend\InvalidBackend; use OCA\Files_External\NotFoundException; use OCA\Files_External\Lib\StorageConfig; @@ -179,7 +181,7 @@ abstract class StoragesServiceTest extends \Test\TestCase { } protected function getBackendMock($class = '\OCA\Files_External\Lib\Backend\SMB', $storageClass = '\OCA\Files_External\Lib\Storage\SMB') { - $backend = $this->getMockBuilder('\OCA\Files_External\Lib\Backend\Backend') + $backend = $this->getMockBuilder(Backend::class) ->disableOriginalConstructor() ->getMock(); $backend->method('getStorageClass') @@ -190,7 +192,7 @@ abstract class StoragesServiceTest extends \Test\TestCase { } protected function getAuthMechMock($scheme = 'null', $class = '\OCA\Files_External\Lib\Auth\NullMechanism') { - $authMech = $this->getMockBuilder('\OCA\Files_External\Lib\Auth\AuthMechanism') + $authMech = $this->getMockBuilder(AuthMechanism::class) ->disableOriginalConstructor() ->getMock(); $authMech->method('getScheme') @@ -204,7 +206,7 @@ abstract class StoragesServiceTest extends \Test\TestCase { /** * Creates a StorageConfig instance based on array data * - * @param array data + * @param array $data * * @return StorageConfig storage config instance */ |