mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 21:22:40 +00:00
Fix NCNv1 tests
- Version report test was failing - Added test for offset=0
This commit is contained in:
parent
6d4aa4db6e
commit
e797de05c2
1 changed files with 7 additions and 1 deletions
|
@ -417,7 +417,10 @@ class TestNCNV1_2 extends Test\AbstractTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
function testRetrieveServerVersion() {
|
function testRetrieveServerVersion() {
|
||||||
$exp = new Response(200, ['version' => \JKingWeb\Arsse\VERSION]);
|
$exp = new Response(200, [
|
||||||
|
'arsse_version' => \JKingWeb\Arsse\VERSION,
|
||||||
|
'version' => REST\NextCloudNews\V1_2::VERSION,
|
||||||
|
]);
|
||||||
$this->assertEquals($exp, $this->h->dispatch(new Request("GET", "/version")));
|
$this->assertEquals($exp, $this->h->dispatch(new Request("GET", "/version")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,6 +594,7 @@ class TestNCNV1_2 extends Test\AbstractTest {
|
||||||
['getRead' => true],
|
['getRead' => true],
|
||||||
['getRead' => false],
|
['getRead' => false],
|
||||||
['lastModified' => $t->getTimestamp()],
|
['lastModified' => $t->getTimestamp()],
|
||||||
|
['oldestFirst' => false, 'batchSize' => 5, 'offset' => 0], // offset=0 should not set the latestEdition context
|
||||||
];
|
];
|
||||||
Phake::when(Data::$db)->articleList(Data::$user->id, $this->anything())->thenReturn($res);
|
Phake::when(Data::$db)->articleList(Data::$user->id, $this->anything())->thenReturn($res);
|
||||||
Phake::when(Data::$db)->articleList(Data::$user->id, (new Context)->reverse(true)->subscription(42))->thenThrow(new ExceptionInput("idMissing"));
|
Phake::when(Data::$db)->articleList(Data::$user->id, (new Context)->reverse(true)->subscription(42))->thenThrow(new ExceptionInput("idMissing"));
|
||||||
|
@ -611,6 +615,7 @@ class TestNCNV1_2 extends Test\AbstractTest {
|
||||||
$this->h->dispatch(new Request("GET", "/items", json_encode($in[6]), 'application/json')); // fourth instance of base context
|
$this->h->dispatch(new Request("GET", "/items", json_encode($in[6]), 'application/json')); // fourth instance of base context
|
||||||
$this->h->dispatch(new Request("GET", "/items", json_encode($in[7]), 'application/json'));
|
$this->h->dispatch(new Request("GET", "/items", json_encode($in[7]), 'application/json'));
|
||||||
$this->h->dispatch(new Request("GET", "/items", json_encode($in[8]), 'application/json'));
|
$this->h->dispatch(new Request("GET", "/items", json_encode($in[8]), 'application/json'));
|
||||||
|
$this->h->dispatch(new Request("GET", "/items", json_encode($in[9]), 'application/json'));
|
||||||
// perform method verifications
|
// perform method verifications
|
||||||
Phake::verify(Data::$db, Phake::times(4))->articleList(Data::$user->id, (new Context)->reverse(true));
|
Phake::verify(Data::$db, Phake::times(4))->articleList(Data::$user->id, (new Context)->reverse(true));
|
||||||
Phake::verify(Data::$db)->articleList(Data::$user->id, (new Context)->reverse(true)->subscription(42));
|
Phake::verify(Data::$db)->articleList(Data::$user->id, (new Context)->reverse(true)->subscription(42));
|
||||||
|
@ -620,6 +625,7 @@ class TestNCNV1_2 extends Test\AbstractTest {
|
||||||
Phake::verify(Data::$db)->articleList(Data::$user->id, (new Context)->reverse(true)->limit(5)->latestEdition(4));
|
Phake::verify(Data::$db)->articleList(Data::$user->id, (new Context)->reverse(true)->limit(5)->latestEdition(4));
|
||||||
Phake::verify(Data::$db)->articleList(Data::$user->id, (new Context)->reverse(true)->unread(true));
|
Phake::verify(Data::$db)->articleList(Data::$user->id, (new Context)->reverse(true)->unread(true));
|
||||||
Phake::verify(Data::$db)->articleList(Data::$user->id, (new Context)->reverse(true)->modifiedSince($t));
|
Phake::verify(Data::$db)->articleList(Data::$user->id, (new Context)->reverse(true)->modifiedSince($t));
|
||||||
|
Phake::verify(Data::$db)->articleList(Data::$user->id, (new Context)->reverse(true)->limit(5));
|
||||||
}
|
}
|
||||||
|
|
||||||
function testMarkAFolderRead() {
|
function testMarkAFolderRead() {
|
||||||
|
|
Loading…
Reference in a new issue