[Pkg-owncloud-commits] [owncloud] 121/145: fix sharing unit tests
David Prévot
taffit at moszumanska.debian.org
Wed Feb 26 16:27:47 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 5348e2eb5445a2d33f6aacd3b2204f15c31a3775
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date: Wed Feb 19 16:56:37 2014 +0100
fix sharing unit tests
---
tests/lib/share/backend.php | 8 ++++----
tests/lib/share/share.php | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/lib/share/backend.php b/tests/lib/share/backend.php
index 2f6c846..420bd9d 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 d6acee6..778a9b0 100644
--- a/tests/lib/share/share.php
+++ b/tests/lib/share/share.php
@@ -615,21 +615,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.'
);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list