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

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2014-02-21 17:24:51 +0400
committerBjörn Schießle <schiessle@owncloud.com>2014-02-21 17:24:51 +0400
commit6bde602c093bcd7f8ec06c2b7b4cde4abb8fb9c1 (patch)
tree148fcfde2eeced075518515c28b33f74a9566661 /tests
parent29c43ddb91f09660c070962b9809d8efef78584e (diff)
parentcf7ef0d35686a4a418abab2c7ad798b56a9317a3 (diff)
Merge pull request #7292 from owncloud/sharing_tests
fix sharing unit tests
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/share/backend.php8
-rw-r--r--tests/lib/share/share.php6
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/lib/share/backend.php b/tests/lib/share/backend.php
index 2f6c84678ff..420bd9d88b3 100644
--- a/tests/lib/share/backend.php
+++ b/tests/lib/share/backend.php
@@ -26,7 +26,7 @@ class Test_Share_Backend implements OCP\Share_Backend {
const FORMAT_SOURCE = 0;
const FORMAT_TARGET = 1;
const FORMAT_PERMISSIONS = 2;
-
+
private $testItem1 = 'test.txt';
private $testItem2 = 'share.txt';
@@ -57,11 +57,11 @@ class Test_Share_Backend implements OCP\Share_Backend {
public function formatItems($items, $format, $parameters = null) {
$testItems = array();
foreach ($items as $item) {
- if ($format == self::FORMAT_SOURCE) {
+ if ($format === self::FORMAT_SOURCE) {
$testItems[] = $item['item_source'];
- } else if ($format == self::FORMAT_TARGET) {
+ } else if ($format === self::FORMAT_TARGET) {
$testItems[] = $item['item_target'];
- } else if ($format == self::FORMAT_PERMISSIONS) {
+ } else if ($format === self::FORMAT_PERMISSIONS) {
$testItems[] = $item['permissions'];
}
}
diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php
index a89f100d97a..b5cba9430aa 100644
--- a/tests/lib/share/share.php
+++ b/tests/lib/share/share.php
@@ -622,21 +622,21 @@ class Test_Share extends PHPUnit_Framework_TestCase {
OC_User::setUserId($this->user1);
$this->assertEquals(
array('test.txt', 'test.txt'),
- OCP\Share::getItemsShared('test', 'test.txt'),
+ OCP\Share::getItemsShared('test', Test_Share_Backend::FORMAT_SOURCE),
'Failed asserting that the test.txt file is shared exactly two times by user1.'
);
OC_User::setUserId($this->user2);
$this->assertEquals(
array('test.txt'),
- OCP\Share::getItemsShared('test', 'test.txt'),
+ OCP\Share::getItemsShared('test', Test_Share_Backend::FORMAT_SOURCE),
'Failed asserting that the test.txt file is shared exactly once by user2.'
);
OC_User::setUserId($this->user3);
$this->assertEquals(
array('test.txt'),
- OCP\Share::getItemsShared('test', 'test.txt'),
+ OCP\Share::getItemsShared('test', Test_Share_Backend::FORMAT_SOURCE),
'Failed asserting that the test.txt file is shared exactly once by user3.'
);