From 5af0cb6e225468599da10e1c6fa7cd870f9c56ec Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Sun, 20 Mar 2022 10:56:49 +0100 Subject: update last_modified when marking an item as read Signed-off-by: Benjamin Brahmer this way it works Signed-off-by: Benjamin Brahmer add changelog entry Signed-off-by: Benjamin Brahmer Partly fix test Signed-off-by: Benjamin Brahmer test passing Signed-off-by: Benjamin Brahmer --- tests/Unit/Db/FeedMapperTest.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'tests/Unit/Db/FeedMapperTest.php') diff --git a/tests/Unit/Db/FeedMapperTest.php b/tests/Unit/Db/FeedMapperTest.php index 499989062..7830d266c 100644 --- a/tests/Unit/Db/FeedMapperTest.php +++ b/tests/Unit/Db/FeedMapperTest.php @@ -49,6 +49,7 @@ class FeedMapperTest extends MapperTestUtility $feed2->resetUpdatedFields(); $this->feeds = [$feed1, $feed2]; + } /** @@ -519,13 +520,13 @@ class FeedMapperTest extends MapperTestUtility ->with('news_items') ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->exactly(2)) ->method('createParameter') ->will($this->returnArgument(0)); - $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(2)) @@ -533,11 +534,11 @@ class FeedMapperTest extends MapperTestUtility ->withConsecutive(['id IN (:idList)'], ['unread != :unread']) ->will($this->returnSelf()); - $this->builder->expects($this->exactly(2)) + $this->builder->expects($this->exactly(3)) ->method('setParameter') - ->withConsecutive(['unread', false], ['idList', [1, 2]]) + ->withConsecutive(['unread', false], ['idList', [1, 2]], ['last_modified']) ->will($this->returnSelf()); - + $this->builder->expects($this->exactly(1)) ->method('getSQL') ->will($this->returnValue('QUERY')); @@ -616,7 +617,7 @@ class FeedMapperTest extends MapperTestUtility ->with('SQL QUERY') ->willReturn($result); - $this->builder->expects($this->once()) + $this->builder->expects($this->exactly(2)) ->method('createParameter') ->will($this->returnArgument(0)); @@ -625,9 +626,9 @@ class FeedMapperTest 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(2)) @@ -635,9 +636,9 @@ class FeedMapperTest extends MapperTestUtility ->withConsecutive(['id IN (:idList)'], ['unread != :unread']) ->will($this->returnSelf()); - $this->builder->expects($this->exactly(2)) + $this->builder->expects($this->exactly(3)) ->method('setParameter') - ->withConsecutive(['unread', false], ['idList', [1, 2]]) + ->withConsecutive(['unread', false], ['idList', [1, 2]], ['last_modified']) ->will($this->returnSelf()); $this->builder->expects($this->exactly(1)) -- cgit v1.2.3