Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-09-27 16:31:28 +0300
committerJoas Schilling <coding@schilljs.com>2019-10-01 10:25:19 +0300
commit7314559199fe3aa51ee585317c49ae055b9da929 (patch)
tree2a466d11b770bbe70d579a1f9146cae71dcf9a40 /tests
parentc975f6af6ab6956aee852dbaaaa3a28c9790249f (diff)
More IShare::TYPE_* fixes
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/features/bootstrap/SharingContext.php18
-rw-r--r--tests/integration/spreedcheats/lib/Controller/ApiController.php3
-rw-r--r--tests/php/Collaboration/Collaborators/RoomPluginTest.php4
3 files changed, 13 insertions, 12 deletions
diff --git a/tests/integration/features/bootstrap/SharingContext.php b/tests/integration/features/bootstrap/SharingContext.php
index 987ceee8f..184b3fd39 100644
--- a/tests/integration/features/bootstrap/SharingContext.php
+++ b/tests/integration/features/bootstrap/SharingContext.php
@@ -128,7 +128,7 @@ class SharingContext implements Context {
* @param TableNode|null $body
*/
public function userSharesWithUser(string $user, string $path, string $sharee, TableNode $body = null) {
- $this->userSharesWith($user, $path, 0 /*Share::SHARE_TYPE_USER*/, $sharee, $body);
+ $this->userSharesWith($user, $path, 0 /*IShare::TYPE_USER*/, $sharee, $body);
}
/**
@@ -153,7 +153,7 @@ class SharingContext implements Context {
* @param TableNode|null $body
*/
public function userSharesWithGroup(string $user, string $path, string $sharee, TableNode $body = null) {
- $this->userSharesWith($user, $path, 1 /*Share::SHARE_TYPE_GROUP*/, $sharee, $body);
+ $this->userSharesWith($user, $path, 1 /*IShare::TYPE_GROUP*/, $sharee, $body);
}
/**
@@ -178,7 +178,7 @@ class SharingContext implements Context {
* @param TableNode|null $body
*/
public function userSharesWithRoom(string $user, string $path, string $room, TableNode $body = null) {
- $this->userSharesWith($user, $path, 10 /*Share::SHARE_TYPE_ROOM*/, FeatureContext::getTokenForIdentifier($room), $body);
+ $this->userSharesWith($user, $path, 10 /*IShare::TYPE_ROOM*/, FeatureContext::getTokenForIdentifier($room), $body);
}
/**
@@ -202,7 +202,7 @@ class SharingContext implements Context {
* @param TableNode|null $body
*/
public function userSharesByLink(string $user, string $path, TableNode $body = null) {
- $this->userSharesWith($user, $path, 3 /*Share::SHARE_TYPE_LINK*/, '', $body);
+ $this->userSharesWith($user, $path, 3 /*IShare::TYPE_LINK*/, '', $body);
}
/**
@@ -400,7 +400,7 @@ class SharingContext implements Context {
$url = '/apps/files_sharing/api/v1/sharees';
$parameters = [];
- $parameters[] = 'shareType=10'; // Share::SHARE_TYPE_ROOM,
+ $parameters[] = 'shareType=10'; // IShare::TYPE_ROOM,
$parameters[] = 'itemType=file';
foreach ($body->getRowsHash() as $key => $value) {
$parameters[] = $key . '=' . $value;
@@ -562,7 +562,7 @@ class SharingContext implements Context {
$defaultExpectedFields = [
'id' => 'A_NUMBER',
- 'share_type' => '10', // Share::SHARE_TYPE_ROOM,
+ 'share_type' => '10', // IShare::TYPE_ROOM,
'permissions' => '19',
'stime' => 'A_NUMBER',
'parent' => '',
@@ -586,7 +586,7 @@ class SharingContext implements Context {
}
if (array_key_exists('share_type', $expectedFields) &&
- $expectedFields['share_type'] == 10 /* Share::SHARE_TYPE_ROOM */ &&
+ $expectedFields['share_type'] == 10 /* IShare::TYPE_ROOM */ &&
array_key_exists('share_with', $expectedFields)) {
if ($expectedFields['share_with'] === 'private_conversation') {
$expectedFields['share_with'] = 'REGEXP /^private_conversation_[0-9a-f]{6}$/';
@@ -607,7 +607,7 @@ class SharingContext implements Context {
* name is checked against the returned "label" value, and the room test
* identifier is used to get the room token, which is checked against the
* returned "shareWith" value. The returned "shareType" value is expected to
- * always be "Share::SHARE_TYPE_ROOM", so there is no need to specify it.
+ * always be "IShare::TYPE_ROOM", so there is no need to specify it.
*
* @param string $shareeType
* @param string $isEmpty
@@ -618,7 +618,7 @@ class SharingContext implements Context {
$sharees = [];
foreach ($shareesList->getRows() as $row) {
$expectedSharee = [$row[0]];
- $expectedSharee[] = 10; // Share::SHARE_TYPE_ROOM
+ $expectedSharee[] = 10; // IShare::TYPE_ROOM
$expectedSharee[] = FeatureContext::getTokenForIdentifier($row[1]);
$sharees[] = $expectedSharee;
}
diff --git a/tests/integration/spreedcheats/lib/Controller/ApiController.php b/tests/integration/spreedcheats/lib/Controller/ApiController.php
index 61aed6ef7..b5537d59a 100644
--- a/tests/integration/spreedcheats/lib/Controller/ApiController.php
+++ b/tests/integration/spreedcheats/lib/Controller/ApiController.php
@@ -27,6 +27,7 @@ use OCP\AppFramework\OCSController;
use OCP\AppFramework\Http\DataResponse;
use OCP\IDBConnection;
use OCP\IRequest;
+use OCP\Share\IShare;
class ApiController extends OCSController {
@@ -62,7 +63,7 @@ class ApiController extends OCSController {
$query = $this->db->getQueryBuilder();
$query->delete('share')
->where($query->expr()->orX(
- $query->expr()->eq('share_type', $query->createNamedParameter(\OCP\Share::SHARE_TYPE_ROOM)),
+ $query->expr()->eq('share_type', $query->createNamedParameter(IShare::TYPE_ROOM)),
$query->expr()->eq('share_type', $query->createNamedParameter(11 /*RoomShareProvider::SHARE_TYPE_USERROOM*/))
))
->execute();
diff --git a/tests/php/Collaboration/Collaborators/RoomPluginTest.php b/tests/php/Collaboration/Collaborators/RoomPluginTest.php
index f4e033942..0be7971b1 100644
--- a/tests/php/Collaboration/Collaborators/RoomPluginTest.php
+++ b/tests/php/Collaboration/Collaborators/RoomPluginTest.php
@@ -31,7 +31,7 @@ use OCP\Collaboration\Collaborators\ISearchResult;
use OCP\Collaboration\Collaborators\SearchResultType;
use OCP\IUser;
use OCP\IUserSession;
-use OCP\Share;
+use OCP\Share\IShare;
class RoomPluginTest extends \Test\TestCase {
@@ -91,7 +91,7 @@ class RoomPluginTest extends \Test\TestCase {
return [
'label' => $label,
'value' => [
- 'shareType' => Share::SHARE_TYPE_ROOM,
+ 'shareType' => IShare::TYPE_ROOM,
'shareWith' => $shareWith
]
];