aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/Node
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-10-24 15:26:53 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-10-24 17:45:32 +0200
commit43e498844e8c1aa519a19238d2cf3d6b95e1aab0 (patch)
tree59510ef2ffc6c1fd1fd92475013b108f1da2bfeb /tests/lib/Files/Node
parentb1f77aca4effec99387481a831910d4870ae2ffc (diff)
downloadnextcloud-server-43e498844e8c1aa519a19238d2cf3d6b95e1aab0.tar.gz
nextcloud-server-43e498844e8c1aa519a19238d2cf3d6b95e1aab0.zip
Use ::class in test mocks
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/lib/Files/Node')
-rw-r--r--tests/lib/Files/Node/NodeTest.php12
-rw-r--r--tests/lib/Files/Node/RootTest.php14
2 files changed, 16 insertions, 10 deletions
diff --git a/tests/lib/Files/Node/NodeTest.php b/tests/lib/Files/Node/NodeTest.php
index 5e18caa2014..160787411f1 100644
--- a/tests/lib/Files/Node/NodeTest.php
+++ b/tests/lib/Files/Node/NodeTest.php
@@ -13,7 +13,10 @@ use OC\Files\View;
use OCP\Files\Config\IUserMountCache;
use OCP\Files\IRootFolder;
use OCP\Files\Node;
+use OCP\Files\Storage;
+use OCP\IConfig;
use OCP\ILogger;
+use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\Files\NotFoundException;
@@ -41,17 +44,18 @@ abstract class NodeTest extends \Test\TestCase {
protected function setUp() {
parent::setUp();
- $config = $this->getMockBuilder('\OCP\IConfig')
+ $config = $this->getMockBuilder(IConfig::class)
->disableOriginalConstructor()
->getMock();
- $urlGenerator = $this->getMockBuilder('\OCP\IURLGenerator')
+ $urlGenerator = $this->getMockBuilder(IURLGenerator
+ ::class)
->disableOriginalConstructor()
->getMock();
$this->user = new \OC\User\User('', new \Test\Util\User\Dummy, null, $config, $urlGenerator);
$this->manager = $this->getMockBuilder('\OC\Files\Mount\Manager')
->disableOriginalConstructor()
->getMock();
- $this->view = $this->getMockBuilder('\OC\Files\View')
+ $this->view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
->getMock();
$this->userMountCache = $this->getMockBuilder('\OCP\Files\Config\IUserMountCache')
@@ -88,7 +92,7 @@ abstract class NodeTest extends \Test\TestCase {
protected abstract function getViewDeleteMethod();
protected function getMockStorage() {
- $storage = $this->getMockBuilder('\OCP\Files\Storage')
+ $storage = $this->getMockBuilder(Storage::class)
->disableOriginalConstructor()
->getMock();
$storage->expects($this->any())
diff --git a/tests/lib/Files/Node/RootTest.php b/tests/lib/Files/Node/RootTest.php
index fbc33cafcd8..2f81a96d486 100644
--- a/tests/lib/Files/Node/RootTest.php
+++ b/tests/lib/Files/Node/RootTest.php
@@ -13,7 +13,9 @@ use OC\Files\FileInfo;
use OC\Files\Mount\Manager;
use OC\Files\Node\Folder;
use OC\Files\View;
+use OCP\IConfig;
use OCP\ILogger;
+use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserManager;
@@ -37,10 +39,10 @@ class RootTest extends \Test\TestCase {
protected function setUp() {
parent::setUp();
- $config = $this->getMockBuilder('\OCP\IConfig')
+ $config = $this->getMockBuilder(IConfig::class)
->disableOriginalConstructor()
->getMock();
- $urlgenerator = $this->getMockBuilder('\OCP\IURLGenerator')
+ $urlgenerator = $this->getMockBuilder(IURLGenerator::class)
->disableOriginalConstructor()
->getMock();
@@ -69,7 +71,7 @@ class RootTest extends \Test\TestCase {
/**
* @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view
*/
- $view = $this->getMockBuilder('\OC\Files\View')
+ $view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
->getMock();
$root = new \OC\Files\Node\Root(
@@ -105,7 +107,7 @@ class RootTest extends \Test\TestCase {
/**
* @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view
*/
- $view = $this->getMockBuilder('\OC\Files\View')
+ $view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
->getMock();
$root = new \OC\Files\Node\Root(
@@ -133,7 +135,7 @@ class RootTest extends \Test\TestCase {
/**
* @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view
*/
- $view = $this->getMockBuilder('\OC\Files\View')
+ $view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
->getMock();
$root = new \OC\Files\Node\Root(
@@ -155,7 +157,7 @@ class RootTest extends \Test\TestCase {
/**
* @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view
*/
- $view = $this->getMockBuilder('\OC\Files\View')
+ $view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
->getMock();
$root = new \OC\Files\Node\Root(