summaryrefslogtreecommitdiffstats
path: root/tests/Unit/Controller/ItemControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Unit/Controller/ItemControllerTest.php')
-rw-r--r--tests/Unit/Controller/ItemControllerTest.php42
1 files changed, 41 insertions, 1 deletions
diff --git a/tests/Unit/Controller/ItemControllerTest.php b/tests/Unit/Controller/ItemControllerTest.php
index 0eae52a39..33488a338 100644
--- a/tests/Unit/Controller/ItemControllerTest.php
+++ b/tests/Unit/Controller/ItemControllerTest.php
@@ -293,6 +293,11 @@ class ItemControllerTest extends TestCase
->with('user', 2, 3, 0, false, false, [])
->will($this->returnValue($result['items']));
+ $this->shareService->expects($this->once())
+ ->method('mapSharedByDisplayNames')
+ ->with($result['items'])
+ ->will($this->returnValue($result['items']));
+
$response = $this->controller->index(ListType::FEED, 2, 3);
$this->assertEquals($result, $response);
}
@@ -330,6 +335,11 @@ class ItemControllerTest extends TestCase
->with('user', 2, 3, 0, false, false, [])
->will($this->returnValue($result['items']));
+ $this->shareService->expects($this->once())
+ ->method('mapSharedByDisplayNames')
+ ->with($result['items'])
+ ->will($this->returnValue($result['items']));
+
$response = $this->controller->index(ListType::FOLDER, 2, 3);
$this->assertEquals($result, $response);
}
@@ -367,6 +377,11 @@ class ItemControllerTest extends TestCase
->with('user', 2, 3, 0, false, [])
->will($this->returnValue($result['items']));
+ $this->shareService->expects($this->once())
+ ->method('mapSharedByDisplayNames')
+ ->with($result['items'])
+ ->will($this->returnValue($result['items']));
+
$response = $this->controller->index(ListType::STARRED, 2, 3);
$this->assertEquals($result, $response);
}
@@ -404,6 +419,11 @@ class ItemControllerTest extends TestCase
->with('user', 2, 3, 0, false, false, ['test', 'search'])
->will($this->returnValue($result['items']));
+ $this->shareService->expects($this->once())
+ ->method('mapSharedByDisplayNames')
+ ->with($result['items'])
+ ->will($this->returnValue($result['items']));
+
$response = $this->controller->index(ListType::FEED, 2, 3, 0, null, null, 'test%20%20search%20');
$this->assertEquals($result, $response);
}
@@ -420,6 +440,11 @@ class ItemControllerTest extends TestCase
->with('user', 2, 3, 10, false, true)
->will($this->returnValue($result['items']));
+ $this->shareService->expects($this->once())
+ ->method('mapSharedByDisplayNames')
+ ->with($result['items'])
+ ->will($this->returnValue($result['items']));
+
$this->feedService->expects($this->never())
->method('findAllForUser');
@@ -477,6 +502,11 @@ class ItemControllerTest extends TestCase
->with('user', 2, 3, false)
->will($this->returnValue($result['items']));
+ $this->shareService->expects($this->once())
+ ->method('mapSharedByDisplayNames')
+ ->with($result['items'])
+ ->will($this->returnValue($result['items']));
+
$response = $this->controller->newItems(ListType::FEED, 2, 3);
$this->assertEquals($result, $response);
}
@@ -517,6 +547,11 @@ class ItemControllerTest extends TestCase
->with('user', 2, 3, false)
->will($this->returnValue($result['items']));
+ $this->shareService->expects($this->once())
+ ->method('mapSharedByDisplayNames')
+ ->with($result['items'])
+ ->will($this->returnValue($result['items']));
+
$response = $this->controller->newItems(ListType::FOLDER, 2, 3);
$this->assertEquals($result, $response);
}
@@ -557,6 +592,11 @@ class ItemControllerTest extends TestCase
->with('user', 6, 3)
->will($this->returnValue($result['items']));
+ $this->shareService->expects($this->once())
+ ->method('mapSharedByDisplayNames')
+ ->with($result['items'])
+ ->will($this->returnValue($result['items']));
+
$response = $this->controller->newItems(ListType::UNREAD, 2, 3);
$this->assertEquals($result, $response);
}
@@ -579,4 +619,4 @@ class ItemControllerTest extends TestCase
}
-} \ No newline at end of file
+}