Be more specific about coverage of Database class
This has uncovered a bug with nextFetch calculation, it seems. Fixing it is deferred for now.
This commit is contained in:
parent
aed3749da8
commit
1ae3c33344
21 changed files with 1170 additions and 22 deletions
|
@ -86,11 +86,16 @@ class Database {
|
|||
|
||||
/** Returns the bare name of the calling context's calling method, when __FUNCTION__ is not appropriate */
|
||||
protected function caller(): string {
|
||||
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 4);
|
||||
if ($trace[2]['function'] === "articleQuery") {
|
||||
return $trace[3]['function'];
|
||||
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10);
|
||||
$out = "";
|
||||
foreach ($trace as $step) {
|
||||
if (($step['class'] ?? "") === __CLASS__) {
|
||||
$out = $step['function'];
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $trace[2]['function'];
|
||||
return $out;
|
||||
}
|
||||
|
||||
/** Returns the current (actual) schema version of the database; compared against self::SCHEMA_VERSION to know when an upgrade is required */
|
||||
|
|
|
@ -427,7 +427,15 @@ trait SeriesArticle {
|
|||
unset($this->data, $this->matches, $this->fields, $this->checkTables, $this->user);
|
||||
}
|
||||
|
||||
/** @dataProvider provideContextMatches */
|
||||
/**
|
||||
* @dataProvider provideContextMatches
|
||||
* @covers \JKingWeb\Arsse\Database::articleList
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testListArticlesCheckingContext(RootContext $c, array $exp): void {
|
||||
$ids = array_column($ids = Arsse::$db->articleList("john.doe@example.com", $c, ["id"], ["id"])->getAll(), "id");
|
||||
sort($ids);
|
||||
|
@ -547,6 +555,14 @@ trait SeriesArticle {
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::editionArticle
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testRetrieveArticleIdsForEditions(): void {
|
||||
$exp = [
|
||||
1 => 1,
|
||||
|
@ -584,16 +600,40 @@ trait SeriesArticle {
|
|||
$this->assertEquals($exp, Arsse::$db->editionArticle(...range(1, 1001)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleList
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testListArticlesOfAMissingFolder(): void {
|
||||
$this->assertException("idMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->articleList($this->user, (new Context)->folder(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleList
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testListArticlesOfAMissingSubscription(): void {
|
||||
$this->assertException("idMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->articleList($this->user, (new Context)->subscription(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleList
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testListArticlesCheckingProperties(): void {
|
||||
$this->user = "john.doe@example.org";
|
||||
// check that the different fieldset groups return the expected columns
|
||||
|
@ -607,7 +647,15 @@ trait SeriesArticle {
|
|||
$this->assertEquals($this->fields, $test);
|
||||
}
|
||||
|
||||
/** @dataProvider provideOrderedLists */
|
||||
/**
|
||||
* @dataProvider provideOrderedLists
|
||||
* @covers \JKingWeb\Arsse\Database::articleList
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testListArticlesCheckingOrder(array $sortCols, array $exp): void {
|
||||
$act = ValueInfo::normalize(array_column(iterator_to_array(Arsse::$db->articleList("john.doe@example.com", null, ["id"], $sortCols)), "id"), ValueInfo::T_INT | ValueInfo::M_ARRAY);
|
||||
$this->assertSame($exp, $act);
|
||||
|
@ -626,10 +674,26 @@ trait SeriesArticle {
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkNothing(): void {
|
||||
$this->assertSame(0, Arsse::$db->articleMark($this->user, []));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesUnread(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => false]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -641,6 +705,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesRead(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => true]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -656,6 +728,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesUnstarred(): void {
|
||||
Arsse::$db->articleMark($this->user, ['starred' => false]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -667,6 +747,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesStarred(): void {
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -682,6 +770,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesUnreadAndUnstarred(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => false,'starred' => false]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -696,6 +792,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesReadAndStarred(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => true,'starred' => true]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -714,6 +818,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesUnreadAndStarred(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => false,'starred' => true]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -732,6 +844,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesReadAndUnstarred(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => true,'starred' => false]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -750,6 +870,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testSetNoteForAllArticles(): void {
|
||||
Arsse::$db->articleMark($this->user, ['note' => "New note"]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -769,6 +897,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkATreeFolder(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => true], (new Context)->folder(7));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -780,6 +916,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkALeafFolder(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => true], (new Context)->folder(8));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -789,6 +933,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAMissingFolder(): void {
|
||||
$this->assertException("idMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->articleMark($this->user, ['read' => true], (new Context)->folder(42));
|
||||
|
@ -803,11 +955,27 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAMissingSubscription(): void {
|
||||
$this->assertException("idMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->articleMark($this->user, ['read' => true], (new Context)->folder(2112));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAnArticle(): void {
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->article(20));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -817,6 +985,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkMultipleArticles(): void {
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->articles([2,4,7,20]));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -827,6 +1003,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkMultipleArticlessUnreadAndStarred(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => false,'starred' => true], (new Context)->articles([2,4,7,20]));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -840,16 +1024,40 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkTooManyMultipleArticles(): void {
|
||||
$setSize = (new \ReflectionClassConstant(Database::class, "LIMIT_SET_SIZE"))->getValue();
|
||||
$this->assertSame(7, Arsse::$db->articleMark($this->user, ['read' => false,'starred' => true], (new Context)->articles(range(1, $setSize * 3))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAMissingArticle(): void {
|
||||
$this->assertException("subjectMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->article(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAnEdition(): void {
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->edition(1001));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -859,6 +1067,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkMultipleEditions(): void {
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->editions([2,4,7,20]));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -869,12 +1085,28 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkMultipleMissingEditions(): void {
|
||||
$this->assertSame(0, Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->editions([500,501])));
|
||||
$state = $this->primeExpectations($this->data, $this->checkTables);
|
||||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkMultipleEditionsUnread(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => false], (new Context)->editions([2,4,7,1001]));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -886,6 +1118,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkMultipleEditionsUnreadWithStale(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => false], (new Context)->editions([2,4,7,20]));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -895,6 +1135,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkMultipleEditionsUnreadAndStarredWithStale(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => false,'starred' => true], (new Context)->editions([2,4,7,20]));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -907,16 +1155,39 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkTooManyMultipleEditions(): void {
|
||||
$this->assertSame(7, Arsse::$db->articleMark($this->user, ['read' => false,'starred' => true], (new Context)->editions(range(1, 51))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAStaleEditionUnread(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => false], (new Context)->edition(20)); // no changes occur
|
||||
$state = $this->primeExpectations($this->data, $this->checkTables);
|
||||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAStaleEditionStarred(): void {
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->edition(20));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -926,6 +1197,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAStaleEditionUnreadAndStarred(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => false,'starred' => true], (new Context)->edition(20)); // only starred is changed
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -935,17 +1214,41 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAStaleEditionUnreadAndUnstarred(): void {
|
||||
Arsse::$db->articleMark($this->user, ['read' => false,'starred' => false], (new Context)->edition(20)); // no changes occur
|
||||
$state = $this->primeExpectations($this->data, $this->checkTables);
|
||||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAMissingEdition(): void {
|
||||
$this->assertException("subjectMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->edition(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkByOldestEdition(): void {
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->editionRange(19, null));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -957,6 +1260,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkByLatestEdition(): void {
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->editionRange(null, 20));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -970,6 +1281,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkByLastMarked(): void {
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->markedRange('2017-01-01T00:00:00Z', null));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -981,6 +1300,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkByNotLastMarked(): void {
|
||||
Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->markedRange(null, '2000-01-01T00:00:00Z'));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -990,6 +1317,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleCount
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testCountArticles(): void {
|
||||
$setSize = (new \ReflectionClassConstant(Database::class, "LIMIT_SET_SIZE"))->getValue();
|
||||
$this->assertSame(2, Arsse::$db->articleCount("john.doe@example.com", (new Context)->starred(true)));
|
||||
|
@ -998,6 +1333,7 @@ trait SeriesArticle {
|
|||
$this->assertSame(10, Arsse::$db->articleCount("john.doe@example.com", (new Context)->articles(range(1, $setSize * 3))));
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::articleStarred */
|
||||
public function testFetchStarredCounts(): void {
|
||||
$exp1 = ['total' => 2, 'unread' => 1, 'read' => 1];
|
||||
$exp2 = ['total' => 0, 'unread' => 0, 'read' => 0];
|
||||
|
@ -1005,17 +1341,20 @@ trait SeriesArticle {
|
|||
$this->assertEquals($exp2, Arsse::$db->articleStarred("jane.doe@example.com"));
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::editionLatest */
|
||||
public function testFetchLatestEdition(): void {
|
||||
$this->assertSame(1001, Arsse::$db->editionLatest($this->user));
|
||||
$this->assertSame(4, Arsse::$db->editionLatest($this->user, (new Context)->subscription(12)));
|
||||
$this->assertSame(5, Arsse::$db->editionLatest("john.doe@example.com", (new Context)->subscription(3)->hidden(false)));
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::editionLatest */
|
||||
public function testFetchLatestEditionOfMissingSubscription(): void {
|
||||
$this->assertException("idMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->editionLatest($this->user, (new Context)->subscription(1));
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::articleLabelsGet */
|
||||
public function testListTheLabelsOfAnArticle(): void {
|
||||
$this->assertEquals([1,2], Arsse::$db->articleLabelsGet("john.doe@example.com", 1));
|
||||
$this->assertEquals([2], Arsse::$db->articleLabelsGet("john.doe@example.com", 5));
|
||||
|
@ -1025,11 +1364,13 @@ trait SeriesArticle {
|
|||
$this->assertEquals([], Arsse::$db->articleLabelsGet("john.doe@example.com", 2, true));
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::articleLabelsGet */
|
||||
public function testListTheLabelsOfAMissingArticle(): void {
|
||||
$this->assertException("subjectMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->articleLabelsGet($this->user, 101);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::articleCategoriesGet */
|
||||
public function testListTheCategoriesOfAnArticle(): void {
|
||||
$exp = ["Fascinating", "Logical"];
|
||||
$this->assertSame($exp, Arsse::$db->articleCategoriesGet($this->user, 19));
|
||||
|
@ -1039,12 +1380,21 @@ trait SeriesArticle {
|
|||
$this->assertSame($exp, Arsse::$db->articleCategoriesGet($this->user, 4));
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::articleCategoriesGet */
|
||||
public function testListTheCategoriesOfAMissingArticle(): void {
|
||||
$this->assertException("subjectMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->articleCategoriesGet($this->user, 101);
|
||||
}
|
||||
|
||||
/** @dataProvider provideArrayContextOptions */
|
||||
/**
|
||||
* @dataProvider provideArrayContextOptions
|
||||
* @covers \JKingWeb\Arsse\Database::articleList
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testUseTooFewValuesInArrayContext(string $option): void {
|
||||
$this->assertException("tooShort", "Db", "ExceptionInput");
|
||||
Arsse::$db->articleList($this->user, (new Context)->$option([]));
|
||||
|
@ -1062,6 +1412,14 @@ trait SeriesArticle {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesNotHidden(): void {
|
||||
Arsse::$db->articleMark("jane.doe@example.com", ['hidden' => false]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -1073,6 +1431,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesHidden(): void {
|
||||
Arsse::$db->articleMark("jane.doe@example.com", ['hidden' => true]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -1083,6 +1449,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesUnreadAndNotHidden(): void {
|
||||
Arsse::$db->articleMark("jane.doe@example.com", ['read' => false, 'hidden' => false]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -1097,6 +1471,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesReadAndHidden(): void {
|
||||
Arsse::$db->articleMark("jane.doe@example.com", ['read' => true, 'hidden' => true]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -1109,6 +1491,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesUnreadAndHidden(): void {
|
||||
Arsse::$db->articleMark("jane.doe@example.com", ['read' => false,'hidden' => true]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -1122,6 +1512,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAllArticlesReadAndNotHidden(): void {
|
||||
Arsse::$db->articleMark("jane.doe@example.com", ['read' => true,'hidden' => false]);
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -1135,6 +1533,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkMultipleEditionsUnreadAndHiddenWithStale(): void {
|
||||
Arsse::$db->articleMark("jane.doe@example.com", ['read' => false,'hidden' => true], (new Context)->editions([1,2,19,20]));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -1148,6 +1554,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAStaleEditionHidden(): void {
|
||||
Arsse::$db->articleMark("jane.doe@example.com", ['hidden' => true], (new Context)->edition(20));
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -1157,6 +1571,14 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAStaleEditionUnreadAndHidden(): void {
|
||||
Arsse::$db->articleMark("jane.doe@example.com", ['read' => false,'hidden' => true], (new Context)->edition(20)); // only starred is changed
|
||||
$now = Date::transform(time(), "sql");
|
||||
|
@ -1166,12 +1588,28 @@ trait SeriesArticle {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleMark
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testMarkAStaleEditionUnreadAndNotHidden(): void {
|
||||
Arsse::$db->articleMark("jane.doe@example.com", ['read' => false,'hidden' => false], (new Context)->edition(20)); // no changes occur
|
||||
$state = $this->primeExpectations($this->data, $this->checkTables);
|
||||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleList
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testSelectScrapedContent(): void {
|
||||
$exp = [
|
||||
['id' => 101, 'content' => "<p>Article content 1</p>"],
|
||||
|
@ -1185,6 +1623,14 @@ trait SeriesArticle {
|
|||
$this->assertResult($exp, Arsse::$db->articleList("jill.doe@example.com", (new Context)->subscription(15), ["id", "content"]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::articleList
|
||||
* @covers \JKingWeb\Arsse\Database::articleQuery
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::articleValidateEdition
|
||||
* @covers \JKingWeb\Arsse\Database::articleColumns
|
||||
* @covers \JKingWeb\Arsse\Database::articleFilter
|
||||
*/
|
||||
public function testSearchScrapedContent(): void {
|
||||
$exp = [
|
||||
['id' => 101, 'content' => "<p>Scraped content 1</p>"],
|
||||
|
|
|
@ -170,6 +170,7 @@ trait SeriesCleanup {
|
|||
unset($this->data);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedCleanup */
|
||||
public function testCleanUpOrphanedFeeds(): void {
|
||||
Arsse::$db->feedCleanup();
|
||||
$now = gmdate("Y-m-d H:i:s");
|
||||
|
@ -182,6 +183,7 @@ trait SeriesCleanup {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedCleanup */
|
||||
public function testCleanUpOrphanedFeedsWithUnlimitedRetention(): void {
|
||||
Arsse::$conf->import([
|
||||
'purgeFeeds' => null,
|
||||
|
@ -196,6 +198,7 @@ trait SeriesCleanup {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::iconCleanup */
|
||||
public function testCleanUpOrphanedIcons(): void {
|
||||
Arsse::$db->iconCleanup();
|
||||
$now = gmdate("Y-m-d H:i:s");
|
||||
|
@ -208,6 +211,7 @@ trait SeriesCleanup {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::iconCleanup */
|
||||
public function testCleanUpOrphanedIconsWithUnlimitedRetention(): void {
|
||||
Arsse::$conf->import([
|
||||
'purgeFeeds' => null,
|
||||
|
@ -222,6 +226,7 @@ trait SeriesCleanup {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::articleCleanup */
|
||||
public function testCleanUpOldArticlesWithStandardRetention(): void {
|
||||
Arsse::$db->articleCleanup();
|
||||
$state = $this->primeExpectations($this->data, [
|
||||
|
@ -233,6 +238,7 @@ trait SeriesCleanup {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::articleCleanup */
|
||||
public function testCleanUpOldArticlesWithUnlimitedReadRetention(): void {
|
||||
Arsse::$conf->import([
|
||||
'purgeArticlesRead' => null,
|
||||
|
@ -247,6 +253,7 @@ trait SeriesCleanup {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::articleCleanup */
|
||||
public function testCleanUpOldArticlesWithUnlimitedUnreadRetention(): void {
|
||||
Arsse::$conf->import([
|
||||
'purgeArticlesUnread' => null,
|
||||
|
@ -261,6 +268,7 @@ trait SeriesCleanup {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::articleCleanup */
|
||||
public function testCleanUpOldArticlesWithUnlimitedRetention(): void {
|
||||
Arsse::$conf->import([
|
||||
'purgeArticlesRead' => null,
|
||||
|
@ -273,6 +281,7 @@ trait SeriesCleanup {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::sessionCleanup */
|
||||
public function testCleanUpExpiredSessions(): void {
|
||||
Arsse::$db->sessionCleanup();
|
||||
$state = $this->primeExpectations($this->data, [
|
||||
|
@ -284,6 +293,7 @@ trait SeriesCleanup {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::tokenCleanup */
|
||||
public function testCleanUpExpiredTokens(): void {
|
||||
Arsse::$db->tokenCleanup();
|
||||
$state = $this->primeExpectations($this->data, [
|
||||
|
|
|
@ -192,10 +192,12 @@ trait SeriesFeed {
|
|||
unset($this->data, $this->matches);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedMatchLatest */
|
||||
public function testListLatestItems(): void {
|
||||
$this->assertResult($this->matches, Arsse::$db->feedMatchLatest(1, 2));
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedMatchIds */
|
||||
public function testMatchItemsById(): void {
|
||||
$this->assertResult($this->matches, Arsse::$db->feedMatchIds(1, ['804e517d623390e71497982c77cf6823180342ebcd2e7d5e32da1e55b09dd180','db3e736c2c492f5def5c5da33ddcbea1824040e9ced2142069276b0a6e291a41']));
|
||||
foreach ($this->matches as $m) {
|
||||
|
@ -207,7 +209,10 @@ trait SeriesFeed {
|
|||
$this->assertResult([['id' => 1]], Arsse::$db->feedMatchIds(1, ['e433653cef2e572eee4215fa299a4a5af9137b2cefd6283c85bd69a32915beda'])); // this ID appears in both feed 1 and feed 2; only one result should be returned
|
||||
}
|
||||
|
||||
/** @dataProvider provideFilterRules */
|
||||
/**
|
||||
* @dataProvider provideFilterRules
|
||||
* @covers \JKingWeb\Arsse\Database::feedRulesGet
|
||||
*/
|
||||
public function testGetRules(int $in, array $exp): void {
|
||||
$this->assertSame($exp, Arsse::$db->feedRulesGet($in));
|
||||
}
|
||||
|
@ -222,6 +227,7 @@ trait SeriesFeed {
|
|||
];
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedUpdate */
|
||||
public function testUpdateAFeed(): void {
|
||||
// update a valid feed with both new and changed items
|
||||
Arsse::$db->feedUpdate(1);
|
||||
|
@ -263,21 +269,25 @@ trait SeriesFeed {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedUpdate */
|
||||
public function testUpdateAMissingFeed(): void {
|
||||
$this->assertException("subjectMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->feedUpdate(2112);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedUpdate */
|
||||
public function testUpdateAnInvalidFeed(): void {
|
||||
$this->assertException("typeViolation", "Db", "ExceptionInput");
|
||||
Arsse::$db->feedUpdate(-1);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedUpdate */
|
||||
public function testUpdateAFeedThrowingExceptions(): void {
|
||||
$this->assertException("invalidUrl", "Feed");
|
||||
Arsse::$db->feedUpdate(3, true);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedUpdate */
|
||||
public function testUpdateAFeedWithEnclosuresAndCategories(): void {
|
||||
Arsse::$db->feedUpdate(5);
|
||||
$state = $this->primeExpectations($this->data, [
|
||||
|
@ -298,6 +308,7 @@ trait SeriesFeed {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedListStale */
|
||||
public function testListStaleFeeds(): void {
|
||||
$this->assertEquals([1,3,4], Arsse::$db->feedListStale());
|
||||
Arsse::$db->feedUpdate(3);
|
||||
|
@ -305,6 +316,7 @@ trait SeriesFeed {
|
|||
$this->assertEquals([1], Arsse::$db->feedListStale());
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedUpdate */
|
||||
public function testCheckIconDuringFeedUpdate(): void {
|
||||
Arsse::$db->feedUpdate(6);
|
||||
$state = $this->primeExpectations($this->data, [
|
||||
|
@ -314,6 +326,7 @@ trait SeriesFeed {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedUpdate */
|
||||
public function testAssignIconDuringFeedUpdate(): void {
|
||||
Arsse::$db->feedUpdate(7);
|
||||
$state = $this->primeExpectations($this->data, [
|
||||
|
@ -324,6 +337,7 @@ trait SeriesFeed {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedUpdate */
|
||||
public function testChangeIconDuringFeedUpdate(): void {
|
||||
Arsse::$db->feedUpdate(8);
|
||||
$state = $this->primeExpectations($this->data, [
|
||||
|
@ -334,6 +348,7 @@ trait SeriesFeed {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedUpdate */
|
||||
public function testAddIconDuringFeedUpdate(): void {
|
||||
Arsse::$db->feedUpdate(9);
|
||||
$state = $this->primeExpectations($this->data, [
|
||||
|
@ -344,4 +359,21 @@ trait SeriesFeed {
|
|||
$state['arsse_icons']['rows'][] = [4,'http://localhost:8000/Icon/SVG2','image/svg+xml','<svg xmlns="http://www.w3.org/2000/svg" width="900" height="600"><rect width="900" height="600" fill="#ED2939"/><rect width="600" height="600" fill="#fff"/><rect width="300" height="600" fill="#002395"/></svg>'];
|
||||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::feedUpdate */
|
||||
public function testUpdateUnmodifiedFeed(): void {
|
||||
$this->markTestIncomplete("FIXME: there is a bug here around calculation of nextFetch date");
|
||||
$state = $this->primeExpectations($this->data, [
|
||||
'arsse_icons' => ["id", "url", "type", "data"],
|
||||
'arsse_feeds' => ["id", "url", "title", "err_count", "err_msg", "modified", "next_fetch", "size", "icon"],
|
||||
'arsse_subscriptions' => ["id", "owner", "feed", "keep_rule", "block_rule"],
|
||||
'arsse_articles' => ["id", "feed", "url", "title", "author", "published", "edited", "content", "guid", "url_title_hash", "url_content_hash", "title_content_hash", "modified"],
|
||||
'arsse_editions' => ["id", "article", "modified"],
|
||||
'arsse_marks' => ["article", "subscription", "read", "starred", "hidden", "modified"],
|
||||
'arsse_enclosures' => ["article", "url", "type"],
|
||||
'arsse_categories' => ["article", "name"],
|
||||
]);
|
||||
Arsse::$db->feedUpdate(4);
|
||||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,6 +99,11 @@ trait SeriesFolder {
|
|||
unset($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderAdd
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateName
|
||||
*/
|
||||
public function testAddARootFolder(): void {
|
||||
$user = "john.doe@example.com";
|
||||
$folderID = $this->nextID("arsse_folders");
|
||||
|
@ -108,11 +113,21 @@ trait SeriesFolder {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderAdd
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateName
|
||||
*/
|
||||
public function testAddADuplicateRootFolder(): void {
|
||||
$this->assertException("constraintViolation", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderAdd("john.doe@example.com", ['name' => "Politics"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderAdd
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateName
|
||||
*/
|
||||
public function testAddANestedFolder(): void {
|
||||
$user = "john.doe@example.com";
|
||||
$folderID = $this->nextID("arsse_folders");
|
||||
|
@ -122,36 +137,70 @@ trait SeriesFolder {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderAdd
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateName
|
||||
*/
|
||||
public function testAddANestedFolderToAMissingParent(): void {
|
||||
$this->assertException("idMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderAdd("john.doe@example.com", ['name' => "Sociology", 'parent' => 2112]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderAdd
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateName
|
||||
*/
|
||||
public function testAddANestedFolderToAnInvalidParent(): void {
|
||||
$this->assertException("typeViolation", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderAdd("john.doe@example.com", ['name' => "Sociology", 'parent' => "stringFolderId"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderAdd
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateName
|
||||
*/
|
||||
public function testAddANestedFolderForTheWrongOwner(): void {
|
||||
$this->assertException("idMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderAdd("john.doe@example.com", ['name' => "Sociology", 'parent' => 4]); // folder ID 4 belongs to Jane
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderAdd
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateName
|
||||
*/
|
||||
public function testAddAFolderWithAMissingName(): void {
|
||||
$this->assertException("missing", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderAdd("john.doe@example.com", []);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderAdd
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateName
|
||||
*/
|
||||
public function testAddAFolderWithABlankName(): void {
|
||||
$this->assertException("missing", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderAdd("john.doe@example.com", ['name' => ""]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderAdd
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateName
|
||||
*/
|
||||
public function testAddAFolderWithAWhitespaceName(): void {
|
||||
$this->assertException("whitespace", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderAdd("john.doe@example.com", ['name' => " "]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderList
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
*/
|
||||
public function testListRootFolders(): void {
|
||||
$exp = [
|
||||
['id' => 5, 'name' => "Politics", 'parent' => null, 'children' => 0, 'feeds' => 2],
|
||||
|
@ -166,6 +215,10 @@ trait SeriesFolder {
|
|||
$this->assertResult($exp, Arsse::$db->folderList("admin@example.net", null, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderList
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
*/
|
||||
public function testListFoldersRecursively(): void {
|
||||
$exp = [
|
||||
['id' => 5, 'name' => "Politics", 'parent' => null, 'children' => 0, 'feeds' => 2],
|
||||
|
@ -185,16 +238,25 @@ trait SeriesFolder {
|
|||
$this->assertResult($exp, Arsse::$db->folderList("jane.doe@example.com", 4, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderList
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
*/
|
||||
public function testListFoldersOfAMissingParent(): void {
|
||||
$this->assertException("idMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderList("john.doe@example.com", 2112);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database::folderList
|
||||
* @covers \JKingWeb\Arsse\Database::folderValidateId
|
||||
*/
|
||||
public function testListFoldersOfTheWrongOwner(): void {
|
||||
$this->assertException("idMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderList("john.doe@example.com", 4); // folder ID 4 belongs to Jane
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::folderRemove */
|
||||
public function testRemoveAFolder(): void {
|
||||
$this->assertTrue(Arsse::$db->folderRemove("john.doe@example.com", 6));
|
||||
$state = $this->primeExpectations($this->data, ['arsse_folders' => ['id','owner', 'parent', 'name']]);
|
||||
|
@ -202,6 +264,7 @@ trait SeriesFolder {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::folderRemove */
|
||||
public function testRemoveAFolderTree(): void {
|
||||
$this->assertTrue(Arsse::$db->folderRemove("john.doe@example.com", 1));
|
||||
$state = $this->primeExpectations($this->data, ['arsse_folders' => ['id','owner', 'parent', 'name']]);
|
||||
|
@ -211,21 +274,25 @@ trait SeriesFolder {
|
|||
$this->compareExpectations(static::$drv, $state);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::folderRemove */
|
||||
public function testRemoveAMissingFolder(): void {
|
||||
$this->assertException("subjectMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderRemove("john.doe@example.com", 2112);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::folderRemove */
|
||||
public function testRemoveAnInvalidFolder(): void {
|
||||
$this->assertException("typeViolation", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderRemove("john.doe@example.com", -1);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::folderRemove */
|
||||
public function testRemoveAFolderOfTheWrongOwner(): void {
|
||||
$this->assertException("subjectMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderRemove("john.doe@example.com", 4); // folder ID 4 belongs to Jane
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::folderPropertiesGet */
|
||||
public function testGetThePropertiesOfAFolder(): void {
|
||||
$exp = [
|
||||
'id' => 6,
|
||||
|
@ -235,25 +302,33 @@ trait SeriesFolder {
|
|||
$this->assertArraySubset($exp, Arsse::$db->folderPropertiesGet("john.doe@example.com", 6));
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::folderPropertiesGet */
|
||||
public function testGetThePropertiesOfAMissingFolder(): void {
|
||||
$this->assertException("subjectMissing", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderPropertiesGet("john.doe@example.com", 2112);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::folderPropertiesGet */
|
||||
public function testGetThePropertiesOfAnInvalidFolder(): void {
|
||||
$this->assertException("typeViolation", "Db", "ExceptionInput");
|
||||
Arsse::$db->folderPropertiesGet("john.doe@example.com", -1);
|
||||
}
|
||||
|
||||
/** @covers \JKingWeb\Arsse\Database::folderPropertiesGet */
|
||||
public function testGetThePropertiesOfAFolderOfTheWrongOwner(): void {
|
||||
$this->assertException("subjectMissing", "Db", "ExceptionInput");
|
||||