From f22fe8ba95bf38c6cc15cff9f6487f090a274e08 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Tue, 31 Oct 2017 09:39:06 -0400 Subject: [PATCH] Tweak catchupFeed --- lib/REST/TinyTinyRSS/API.php | 8 ++------ tests/REST/TinyTinyRSS/TestTinyTinyAPI.php | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/REST/TinyTinyRSS/API.php b/lib/REST/TinyTinyRSS/API.php index fe54ba2..b74e442 100644 --- a/lib/REST/TinyTinyRSS/API.php +++ b/lib/REST/TinyTinyRSS/API.php @@ -65,7 +65,7 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler { 'feed_url' => ValueInfo::T_STRING | ValueInfo::M_STRICT, 'login' => ValueInfo::T_STRING | ValueInfo::M_STRICT, 'feed_id' => ValueInfo::T_INT, - 'article_id' => ValueInfo::T_INT, + 'article_id' => ValueInfo::T_MIXED, // single integer or comma-separated list in getArticle 'label_id' => ValueInfo::T_INT, 'article_ids' => ValueInfo::T_STRING, 'assign' => ValueInfo::T_BOOL | ValueInfo::M_DROP, @@ -891,11 +891,7 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler { $list = array_column(Arsse::$db->labelList(Arsse::$user->id, false)->getAll(), "id"); // perform marking for each label foreach ($list as $id) { - try { - Arsse::$db->articleMark(Arsse::$user->id, ['read' => true], (new Context)->label($id)); - } catch (ExceptionInput $e) { - // ignore errors - } + Arsse::$db->articleMark(Arsse::$user->id, ['read' => true], (new Context)->label($id)); } $tr->commit(); } catch (ExceptionInput $e) { diff --git a/tests/REST/TinyTinyRSS/TestTinyTinyAPI.php b/tests/REST/TinyTinyRSS/TestTinyTinyAPI.php index dcae6b0..19555f0 100644 --- a/tests/REST/TinyTinyRSS/TestTinyTinyAPI.php +++ b/tests/REST/TinyTinyRSS/TestTinyTinyAPI.php @@ -905,7 +905,7 @@ class TestTinyTinyAPI extends Test\AbstractTest { ['op' => "catchupFeed", 'sid' => "PriestsOfSyrinx", 'feed_id' => -2, 'is_cat' => true], ]; $in4 = [ - // this one has a tricky time-based context and will be handled last + // this one has a tricky time-based context ['op' => "catchupFeed", 'sid' => "PriestsOfSyrinx", 'feed_id' => -3], ]; Phake::when(Arsse::$db)->articleMark->thenThrow(new ExceptionInput("typeViolation")); @@ -926,7 +926,7 @@ class TestTinyTinyAPI extends Test\AbstractTest { Phake::verify(Arsse::$db)->articleMark($this->anything(), ['read' => true], (new Context)->folder(42)); // reset the database mock $this->setUp(); - Phake::when(Arsse::$db)->articleMark->thenThrow(new ExceptionInput("typeViolation")); + Phake::when(Arsse::$db)->articleMark->thenReturn(42); Phake::when(Arsse::$db)->subscriptionList($this->anything())->thenReturn(new Result($this->subscriptions)); Phake::when(Arsse::$db)->labelList->thenReturn(new Result($this->labels)); Phake::when(Arsse::$db)->labelList($this->anything(), false)->thenReturn(new Result($this->usedLabels));