Browse Source

Minor fixes for correctness

rpm
J. King 3 years ago
parent
commit
8aca42c882
  1. 2
      lib/REST/Miniflux/V1.php
  2. 2
      lib/REST/TinyTinyRSS/API.php
  3. 1
      tests/cases/REST/TinyTinyRSS/TestAPI.php

2
lib/REST/Miniflux/V1.php

@ -718,7 +718,7 @@ class V1 extends \JKingWeb\Arsse\REST\AbstractHandler {
// otherwise we'd be deleting the entire tree
$tr = Arsse::$db->begin();
foreach (Arsse::$db->subscriptionList(Arsse::$user->id, null, false) as $sub) {
Arsse::$db->subscriptionRemove(Arsse::$user->id, $sub['id']);
Arsse::$db->subscriptionRemove(Arsse::$user->id, (int) $sub['id']);
}
$tr->commit();
}

2
lib/REST/TinyTinyRSS/API.php

@ -1357,7 +1357,7 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
'score' => 0, // score is not implemented as it is not modifiable from the TTRSS API
'note' => strlen((string) $article['note']) ? $article['note'] : null,
'lang' => "", // FIXME: picoFeed should be able to retrieve this information
'tags' => Arsse::$db->articleCategoriesGet(Arsse::$user->id, $article['id']),
'tags' => Arsse::$db->articleCategoriesGet(Arsse::$user->id, (int) $article['id']),
'comments_count' => 0,
'comments_link' => "",
'always_display_attachments' => false,

1
tests/cases/REST/TinyTinyRSS/TestAPI.php

@ -945,6 +945,7 @@ LONG_STRING;
[['label_id' => -1042, 'caption' => ""], [$this->userId, 18, ['name' => ""]], new ExceptionInput("missing"), $this->respGood()],
[['label_id' => -1042, 'caption' => " "], [$this->userId, 18, ['name' => " "]], new ExceptionInput("whitespace"), $this->respGood()],
[['label_id' => -1042], [$this->userId, 18, ['name' => ""]], new ExceptionInput("missing"), $this->respGood()],
[['label_id' => -1042], [$this->userId, 18, ['name' => ""]], new ExceptionInput("typeViolation"), $this->respErr("INCORRECT_USAGE")],
[['label_id' => -1, 'caption' => "Ook"], null, null, $this->respErr("INCORRECT_USAGE")],
[['caption' => "Ook"], null, null, $this->respErr("INCORRECT_USAGE")],
[[], null, null, $this->respErr("INCORRECT_USAGE")],

Loading…
Cancel
Save