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

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-09-14 16:15:11 +0300
committerJoas Schilling <nickvergessen@owncloud.com>2015-09-14 16:38:56 +0300
commite750b6355227d8ed90c41d1ff03725334f99b6a5 (patch)
treeb0694fa600c4bca28d78f213335f16dea2408dd0 /tests
parented1baac6b61a1148170ac5ca2122ba9f834e60f2 (diff)
Add an Etag header for the request
Diffstat (limited to 'tests')
-rw-r--r--tests/controller/EndpointControllerTest.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/controller/EndpointControllerTest.php b/tests/controller/EndpointControllerTest.php
index bcba7a2..422cd0d 100644
--- a/tests/controller/EndpointControllerTest.php
+++ b/tests/controller/EndpointControllerTest.php
@@ -93,7 +93,7 @@ class EndpointControllerTest extends TestCase {
public function dataGet() {
return [
[
- [], [],
+ [], md5(json_encode([])), [],
],
[
[
@@ -104,6 +104,7 @@ class EndpointControllerTest extends TestCase {
->disableOriginalConstructor()
->getMock(),
],
+ md5(json_encode([1, 3])),
['$notification', '$notification'],
],
[
@@ -112,6 +113,7 @@ class EndpointControllerTest extends TestCase {
->disableOriginalConstructor()
->getMock(),
],
+ md5(json_encode([42])),
['$notification'],
],
];
@@ -120,9 +122,10 @@ class EndpointControllerTest extends TestCase {
/**
* @dataProvider dataGet
* @param array $notifications
+ * @param string $expectedETag
* @param array $expectedData
*/
- public function testGet(array $notifications, array $expectedData) {
+ public function testGet(array $notifications, $expectedETag, array $expectedData) {
$controller = $this->getController([
'notificationToArray',
]);
@@ -152,6 +155,7 @@ class EndpointControllerTest extends TestCase {
$response = $controller->get();
$this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $response);
+ $this->assertSame($expectedETag, $response->getETag());
$this->assertSame($expectedData, $response->getData());
}