summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Brahmer <info@b-brahmer.de>2023-04-03 15:27:21 +0200
committerBenjamin Brahmer <info@b-brahmer.de>2023-04-05 19:43:02 +0200
commita70d155ce4684e922b1609e7df30d128b7205dc5 (patch)
tree0c303d0a8f5323bad61cbb69c4b850dd316e5992 /tests
parentf79b6c4751874d243ed881bc377a6426980c01ee (diff)
Set lastmodified in read all
if this is not updated the API won't work correctly and we get sync errors. Adjust test to use item api Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Db/ItemMapperTest.php10
-rw-r--r--tests/api/items.bats2
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/Unit/Db/ItemMapperTest.php b/tests/Unit/Db/ItemMapperTest.php
index 3a4a026d6..80421bc0a 100644
--- a/tests/Unit/Db/ItemMapperTest.php
+++ b/tests/Unit/Db/ItemMapperTest.php
@@ -528,7 +528,7 @@ class ItemMapperTest extends MapperTestUtility
->with('SQL QUERY')
->willReturn($result);
- $this->builder->expects($this->once())
+ $this->builder->expects($this->exactly(2))
->method('createParameter')
->will($this->returnArgument(0));
@@ -537,9 +537,9 @@ class ItemMapperTest extends MapperTestUtility
->with('news_items')
->will($this->returnSelf());
- $this->builder->expects($this->once())
+ $this->builder->expects($this->exactly(2))
->method('set')
- ->with('unread', 'unread')
+ ->withConsecutive(['unread', 'unread'], ['last_modified', 'last_modified'])
->will($this->returnSelf());
$this->builder->expects($this->exactly(1))
@@ -547,9 +547,9 @@ class ItemMapperTest extends MapperTestUtility
->withConsecutive(['id IN (:idList)'])
->will($this->returnSelf());
- $this->builder->expects($this->exactly(2))
+ $this->builder->expects($this->exactly(3))
->method('setParameter')
- ->withConsecutive(['idList', [1, 2]], ['unread', false])
+ ->withConsecutive(['idList', [1, 2]], ['unread', false], ['last_modified'])
->will($this->returnSelf());
$this->builder->expects($this->exactly(1))
diff --git a/tests/api/items.bats b/tests/api/items.bats
index d6896785f..4bb38bf75 100644
--- a/tests/api/items.bats
+++ b/tests/api/items.bats
@@ -67,7 +67,7 @@ teardown() {
SYNC_TIME=$(date +%s)
# mark all items of feed as read, returns nothing (other client marks items as read)
- STATUS_CODE=$(http --ignore-stdin -hdo /tmp/body -a ${user}:${APP_PASSWORD} PUT ${BASE_URLv1}/feeds/$FEEDID/read newestItemId="$max" 2>&1| grep HTTP/)
+ STATUS_CODE=$(http --ignore-stdin -hdo /tmp/body -a ${user}:${APP_PASSWORD} PUT ${BASE_URLv1}/items/read newestItemId="$max" 2>&1| grep HTTP/)
# client 2 checks for updates since last sync
UPDATED_ITEMS=($(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} GET ${BASE_URLv1}/items/updated id=$FEEDID lastModified=$SYNC_TIME | grep -Po '"id":\K([0-9]+)' | tr '\n' ' '))