From a70d155ce4684e922b1609e7df30d128b7205dc5 Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Mon, 3 Apr 2023 15:27:21 +0200 Subject: 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 --- tests/Unit/Db/ItemMapperTest.php | 10 +++++----- tests/api/items.bats | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests') 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' ' ')) -- cgit v1.2.3