summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
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 /apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
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 'apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php')
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php32
1 files changed, 20 insertions, 12 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
index 2b4a886050a..7c735ca2334 100644
--- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
@@ -23,6 +23,14 @@
*/
namespace OCA\DAV\Tests\unit\Connector\Sabre;
+use OCA\DAV\Connector\Sabre\Directory;
+use OCA\DAV\Connector\Sabre\File;
+use OCP\Files\Folder;
+use OCP\IUser;
+use OCP\IUserSession;
+use OCP\Share\IManager;
+use Sabre\DAV\Tree;
+
class SharesPluginTest extends \Test\TestCase {
const SHARETYPES_PROPERTYNAME = \OCA\DAV\Connector\Sabre\SharesPlugin::SHARETYPES_PROPERTYNAME;
@@ -55,26 +63,26 @@ class SharesPluginTest extends \Test\TestCase {
public function setUp() {
parent::setUp();
$this->server = new \Sabre\DAV\Server();
- $this->tree = $this->getMockBuilder('\Sabre\DAV\Tree')
+ $this->tree = $this->getMockBuilder(Tree::class)
->disableOriginalConstructor()
->getMock();
- $this->shareManager = $this->getMockBuilder('\OCP\Share\IManager')
+ $this->shareManager = $this->getMockBuilder(IManager::class)
->disableOriginalConstructor()
->getMock();
- $user = $this->getMockBuilder('\OCP\IUser')
+ $user = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();
$user->expects($this->once())
->method('getUID')
->will($this->returnValue('user1'));
- $userSession = $this->getMockBuilder('\OCP\IUserSession')
+ $userSession = $this->getMockBuilder(IUserSession::class)
->disableOriginalConstructor()
->getMock();
$userSession->expects($this->once())
->method('getUser')
->will($this->returnValue($user));
- $this->userFolder = $this->getMockBuilder('\OCP\Files\Folder')
+ $this->userFolder = $this->getMockBuilder(Folder::class)
->disableOriginalConstructor()
->getMock();
@@ -102,7 +110,7 @@ class SharesPluginTest extends \Test\TestCase {
->will($this->returnValue('/subdir'));
// node API nodes
- $node = $this->getMockBuilder('\OCP\Files\Folder')
+ $node = $this->getMockBuilder(Folder::class)
->disableOriginalConstructor()
->getMock();
@@ -149,7 +157,7 @@ class SharesPluginTest extends \Test\TestCase {
* @dataProvider sharesGetPropertiesDataProvider
*/
public function testPreloadThenGetProperties($shareTypes) {
- $sabreNode1 = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\File')
+ $sabreNode1 = $this->getMockBuilder(File::class)
->disableOriginalConstructor()
->getMock();
$sabreNode1->expects($this->any())
@@ -157,7 +165,7 @@ class SharesPluginTest extends \Test\TestCase {
->will($this->returnValue(111));
$sabreNode1->expects($this->any())
->method('getPath');
- $sabreNode2 = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\File')
+ $sabreNode2 = $this->getMockBuilder(File::class)
->disableOriginalConstructor()
->getMock();
$sabreNode2->expects($this->any())
@@ -167,7 +175,7 @@ class SharesPluginTest extends \Test\TestCase {
->method('getPath')
->will($this->returnValue('/subdir/foo'));
- $sabreNode = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Directory')
+ $sabreNode = $this->getMockBuilder(Directory::class)
->disableOriginalConstructor()
->getMock();
$sabreNode->expects($this->any())
@@ -181,19 +189,19 @@ class SharesPluginTest extends \Test\TestCase {
->will($this->returnValue('/subdir'));
// node API nodes
- $node = $this->getMockBuilder('\OCP\Files\Folder')
+ $node = $this->getMockBuilder(Folder::class)
->disableOriginalConstructor()
->getMock();
$node->expects($this->any())
->method('getId')
->will($this->returnValue(123));
- $node1 = $this->getMockBuilder('\OCP\Files\File')
+ $node1 = $this->getMockBuilder(File::class)
->disableOriginalConstructor()
->getMock();
$node1->expects($this->any())
->method('getId')
->will($this->returnValue(111));
- $node2 = $this->getMockBuilder('\OCP\Files\File')
+ $node2 = $this->getMockBuilder(File::class)
->disableOriginalConstructor()
->getMock();
$node2->expects($this->any())