diff --git a/.gitignore b/.gitignore index 11832444..2af8cf64 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ /.php_cs.cache /.php-cs-fixer.cache /tests/.phpunit.result.cache +/tests/.phpunit.cache # Dependencies diff --git a/tests/cases/Database/SeriesArticle.php b/tests/cases/Database/SeriesArticle.php index 1bc3ff14..5e673ec7 100644 --- a/tests/cases/Database/SeriesArticle.php +++ b/tests/cases/Database/SeriesArticle.php @@ -431,12 +431,12 @@ trait SeriesArticle { } - #[CoversMethod(Database::class, "articleList")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleList")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] #[DataProvider("provideContextMatches")] public function testListArticlesCheckingContext(RootContext $c, array $exp): void { $ids = array_column($ids = Arsse::$db->articleList("john.doe@example.com", $c, ["id"], ["id"])->getAll(), "id"); @@ -557,12 +557,12 @@ trait SeriesArticle { ]; } - #[CoversMethod(Database::class, "editionArticle")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "editionArticle")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testRetrieveArticleIdsForEditions(): void { $exp = [ 1 => 1, @@ -601,34 +601,34 @@ trait SeriesArticle { } - #[CoversMethod(Database::class, "articleList")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleList")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testListArticlesOfAMissingFolder(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->articleList($this->user, (new Context)->folder(1)); } - #[CoversMethod(Database::class, "articleList")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleList")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testListArticlesOfAMissingSubscription(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->articleList($this->user, (new Context)->subscription(1)); } - #[CoversMethod(Database::class, "articleList")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleList")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testListArticlesCheckingProperties(): void { $this->user = "john.doe@example.org"; // check that the different fieldset groups return the expected columns @@ -643,12 +643,12 @@ trait SeriesArticle { } #[DataProvider("provideOrderedLists")] - #[CoversMethod(Database::class, "articleList")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleList")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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); @@ -667,22 +667,22 @@ trait SeriesArticle { ]; } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkNothing(): void { $this->assertSame(0, Arsse::$db->articleMark($this->user, [])); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesUnread(): void { Arsse::$db->articleMark($this->user, ['read' => false]); $now = Date::transform(time(), "sql"); @@ -694,12 +694,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesRead(): void { Arsse::$db->articleMark($this->user, ['read' => true]); $now = Date::transform(time(), "sql"); @@ -715,12 +715,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesUnstarred(): void { Arsse::$db->articleMark($this->user, ['starred' => false]); $now = Date::transform(time(), "sql"); @@ -732,12 +732,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesStarred(): void { Arsse::$db->articleMark($this->user, ['starred' => true]); $now = Date::transform(time(), "sql"); @@ -753,12 +753,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesUnreadAndUnstarred(): void { Arsse::$db->articleMark($this->user, ['read' => false,'starred' => false]); $now = Date::transform(time(), "sql"); @@ -773,12 +773,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesReadAndStarred(): void { Arsse::$db->articleMark($this->user, ['read' => true,'starred' => true]); $now = Date::transform(time(), "sql"); @@ -797,12 +797,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesUnreadAndStarred(): void { Arsse::$db->articleMark($this->user, ['read' => false,'starred' => true]); $now = Date::transform(time(), "sql"); @@ -821,12 +821,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesReadAndUnstarred(): void { Arsse::$db->articleMark($this->user, ['read' => true,'starred' => false]); $now = Date::transform(time(), "sql"); @@ -845,12 +845,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testSetNoteForAllArticles(): void { Arsse::$db->articleMark($this->user, ['note' => "New note"]); $now = Date::transform(time(), "sql"); @@ -870,12 +870,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkATreeFolder(): void { Arsse::$db->articleMark($this->user, ['read' => true], (new Context)->folder(7)); $now = Date::transform(time(), "sql"); @@ -887,12 +887,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkALeafFolder(): void { Arsse::$db->articleMark($this->user, ['read' => true], (new Context)->folder(8)); $now = Date::transform(time(), "sql"); @@ -902,12 +902,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAMissingFolder(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->articleMark($this->user, ['read' => true], (new Context)->folder(42)); @@ -922,23 +922,23 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAMissingSubscription(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->articleMark($this->user, ['read' => true], (new Context)->folder(2112)); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAnArticle(): void { Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->article(20)); $now = Date::transform(time(), "sql"); @@ -948,12 +948,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkMultipleArticles(): void { Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->articles([2,4,7,20])); $now = Date::transform(time(), "sql"); @@ -964,12 +964,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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"); @@ -983,34 +983,34 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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)))); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAMissingArticle(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->article(1)); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAnEdition(): void { Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->edition(1001)); $now = Date::transform(time(), "sql"); @@ -1020,12 +1020,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkMultipleEditions(): void { Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->editions([2,4,7,20])); $now = Date::transform(time(), "sql"); @@ -1036,24 +1036,24 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkMultipleEditionsUnread(): void { Arsse::$db->articleMark($this->user, ['read' => false], (new Context)->editions([2,4,7,1001])); $now = Date::transform(time(), "sql"); @@ -1065,12 +1065,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkMultipleEditionsUnreadWithStale(): void { Arsse::$db->articleMark($this->user, ['read' => false], (new Context)->editions([2,4,7,20])); $now = Date::transform(time(), "sql"); @@ -1080,12 +1080,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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"); @@ -1098,33 +1098,33 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkTooManyMultipleEditions(): void { $this->assertSame(7, Arsse::$db->articleMark($this->user, ['read' => false,'starred' => true], (new Context)->editions(range(1, 51)))); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "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); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAStaleEditionStarred(): void { Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->edition(20)); $now = Date::transform(time(), "sql"); @@ -1134,12 +1134,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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"); @@ -1149,35 +1149,35 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAMissingEdition(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->edition(2)); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkByOldestEdition(): void { Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->editionRange(19, null)); $now = Date::transform(time(), "sql"); @@ -1189,12 +1189,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkByLatestEdition(): void { Arsse::$db->articleMark($this->user, ['starred' => true], (new Context)->editionRange(null, 20)); $now = Date::transform(time(), "sql"); @@ -1208,12 +1208,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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"); @@ -1225,12 +1225,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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"); @@ -1240,12 +1240,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleCount")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleCount")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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))); @@ -1254,7 +1254,7 @@ trait SeriesArticle { $this->assertSame(10, Arsse::$db->articleCount("john.doe@example.com", (new Context)->articles(range(1, $setSize * 3)))); } - #[CoversMethod(Database::class, "articleStarred")] + //#[CoversMethod(Database::class, "articleStarred")] public function testFetchStarredCounts(): void { $exp1 = ['total' => 2, 'unread' => 1, 'read' => 1]; $exp2 = ['total' => 0, 'unread' => 0, 'read' => 0]; @@ -1262,20 +1262,20 @@ trait SeriesArticle { $this->assertEquals($exp2, Arsse::$db->articleStarred("jane.doe@example.com")); } - #[CoversMethod(Database::class, "editionLatest")] + //#[CoversMethod(Database::class, "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))); } - #[CoversMethod(Database::class, "editionLatest")] + //#[CoversMethod(Database::class, "editionLatest")] public function testFetchLatestEditionOfMissingSubscription(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->editionLatest($this->user, (new Context)->subscription(1)); } - #[CoversMethod(Database::class, "articleLabelsGet")] + //#[CoversMethod(Database::class, "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)); @@ -1285,13 +1285,13 @@ trait SeriesArticle { $this->assertEquals([], Arsse::$db->articleLabelsGet("john.doe@example.com", 2, true)); } - #[CoversMethod(Database::class, "articleLabelsGet")] + //#[CoversMethod(Database::class, "articleLabelsGet")] public function testListTheLabelsOfAMissingArticle(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->articleLabelsGet($this->user, 101); } - #[CoversMethod(Database::class, "articleCategoriesGet")] + //#[CoversMethod(Database::class, "articleCategoriesGet")] public function testListTheCategoriesOfAnArticle(): void { $exp = ["Fascinating", "Logical"]; $this->assertSame($exp, Arsse::$db->articleCategoriesGet($this->user, 19)); @@ -1301,19 +1301,19 @@ trait SeriesArticle { $this->assertSame($exp, Arsse::$db->articleCategoriesGet($this->user, 4)); } - #[CoversMethod(Database::class, "articleCategoriesGet")] + //#[CoversMethod(Database::class, "articleCategoriesGet")] public function testListTheCategoriesOfAMissingArticle(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->articleCategoriesGet($this->user, 101); } #[DataProvider("provideArrayContextOptions")] - #[CoversMethod(Database::class, "articleList")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleList")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testUseTooFewValuesInArrayContext(string $option): void { $this->assertException("tooShort", "Db", "ExceptionInput"); Arsse::$db->articleList($this->user, (new Context)->$option([])); @@ -1331,12 +1331,12 @@ trait SeriesArticle { } } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesNotHidden(): void { Arsse::$db->articleMark("jane.doe@example.com", ['hidden' => false]); $now = Date::transform(time(), "sql"); @@ -1348,12 +1348,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesHidden(): void { Arsse::$db->articleMark("jane.doe@example.com", ['hidden' => true]); $now = Date::transform(time(), "sql"); @@ -1364,12 +1364,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesUnreadAndNotHidden(): void { Arsse::$db->articleMark("jane.doe@example.com", ['read' => false, 'hidden' => false]); $now = Date::transform(time(), "sql"); @@ -1384,12 +1384,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesReadAndHidden(): void { Arsse::$db->articleMark("jane.doe@example.com", ['read' => true, 'hidden' => true]); $now = Date::transform(time(), "sql"); @@ -1402,12 +1402,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesUnreadAndHidden(): void { Arsse::$db->articleMark("jane.doe@example.com", ['read' => false,'hidden' => true]); $now = Date::transform(time(), "sql"); @@ -1421,12 +1421,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAllArticlesReadAndNotHidden(): void { Arsse::$db->articleMark("jane.doe@example.com", ['read' => true,'hidden' => false]); $now = Date::transform(time(), "sql"); @@ -1440,12 +1440,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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"); @@ -1459,12 +1459,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testMarkAStaleEditionHidden(): void { Arsse::$db->articleMark("jane.doe@example.com", ['hidden' => true], (new Context)->edition(20)); $now = Date::transform(time(), "sql"); @@ -1474,12 +1474,12 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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"); @@ -1489,24 +1489,24 @@ trait SeriesArticle { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleMark")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleMark")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "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); } - #[CoversMethod(Database::class, "articleList")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleList")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testSelectScrapedContent(): void { $exp = [ ['id' => 101, 'content' => "
Article content 1
"], @@ -1520,12 +1520,12 @@ trait SeriesArticle { $this->assertResult($exp, Arsse::$db->articleList("jill.doe@example.com", (new Context)->subscription(15), ["id", "content"])); } - #[CoversMethod(Database::class, "articleList")] - #[CoversMethod(Database::class, "articleQuery")] - #[CoversMethod(Database::class, "articleValidateId")] - #[CoversMethod(Database::class, "articleValidateEdition")] - #[CoversMethod(Database::class, "articleColumns")] - #[CoversMethod(Database::class, "articleFilter")] + //#[CoversMethod(Database::class, "articleList")] + //#[CoversMethod(Database::class, "articleQuery")] + //#[CoversMethod(Database::class, "articleValidateId")] + //#[CoversMethod(Database::class, "articleValidateEdition")] + //#[CoversMethod(Database::class, "articleColumns")] + //#[CoversMethod(Database::class, "articleFilter")] public function testSearchScrapedContent(): void { $exp = [ ['id' => 101, 'content' => "Scraped content 1
"], diff --git a/tests/cases/Database/SeriesCleanup.php b/tests/cases/Database/SeriesCleanup.php index f084192e..ed1075f7 100644 --- a/tests/cases/Database/SeriesCleanup.php +++ b/tests/cases/Database/SeriesCleanup.php @@ -173,7 +173,7 @@ trait SeriesCleanup { unset($this->data); } - #[CoversMethod(Database::class, "feedCleanup")] + //#[CoversMethod(Database::class, "feedCleanup")] public function testCleanUpOrphanedFeeds(): void { Arsse::$db->feedCleanup(); $now = gmdate("Y-m-d H:i:s"); @@ -186,7 +186,7 @@ trait SeriesCleanup { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "feedCleanup")] + //#[CoversMethod(Database::class, "feedCleanup")] public function testCleanUpOrphanedFeedsWithUnlimitedRetention(): void { Arsse::$conf->import([ 'purgeFeeds' => null, @@ -201,7 +201,7 @@ trait SeriesCleanup { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "iconCleanup")] + //#[CoversMethod(Database::class, "iconCleanup")] public function testCleanUpOrphanedIcons(): void { Arsse::$db->iconCleanup(); $now = gmdate("Y-m-d H:i:s"); @@ -214,7 +214,7 @@ trait SeriesCleanup { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "iconCleanup")] + //#[CoversMethod(Database::class, "iconCleanup")] public function testCleanUpOrphanedIconsWithUnlimitedRetention(): void { Arsse::$conf->import([ 'purgeFeeds' => null, @@ -229,7 +229,7 @@ trait SeriesCleanup { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleCleanup")] + //#[CoversMethod(Database::class, "articleCleanup")] public function testCleanUpOldArticlesWithStandardRetention(): void { Arsse::$db->articleCleanup(); $state = $this->primeExpectations($this->data, [ @@ -241,7 +241,7 @@ trait SeriesCleanup { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleCleanup")] + //#[CoversMethod(Database::class, "articleCleanup")] public function testCleanUpOldArticlesWithUnlimitedReadRetention(): void { Arsse::$conf->import([ 'purgeArticlesRead' => null, @@ -256,7 +256,7 @@ trait SeriesCleanup { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleCleanup")] + //#[CoversMethod(Database::class, "articleCleanup")] public function testCleanUpOldArticlesWithUnlimitedUnreadRetention(): void { Arsse::$conf->import([ 'purgeArticlesUnread' => null, @@ -271,7 +271,7 @@ trait SeriesCleanup { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "articleCleanup")] + //#[CoversMethod(Database::class, "articleCleanup")] public function testCleanUpOldArticlesWithUnlimitedRetention(): void { Arsse::$conf->import([ 'purgeArticlesRead' => null, @@ -284,7 +284,7 @@ trait SeriesCleanup { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "sessionCleanup")] + //#[CoversMethod(Database::class, "sessionCleanup")] public function testCleanUpExpiredSessions(): void { Arsse::$db->sessionCleanup(); $state = $this->primeExpectations($this->data, [ @@ -296,7 +296,7 @@ trait SeriesCleanup { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tokenCleanup")] + //#[CoversMethod(Database::class, "tokenCleanup")] public function testCleanUpExpiredTokens(): void { Arsse::$db->tokenCleanup(); $state = $this->primeExpectations($this->data, [ diff --git a/tests/cases/Database/SeriesFeed.php b/tests/cases/Database/SeriesFeed.php index 83054c4d..b4d0688d 100644 --- a/tests/cases/Database/SeriesFeed.php +++ b/tests/cases/Database/SeriesFeed.php @@ -196,12 +196,12 @@ trait SeriesFeed { unset($this->data, $this->matches); } - #[CoversMethod(Database::class, "feedMatchLatest")] + //#[CoversMethod(Database::class, "feedMatchLatest")] public function testListLatestItems(): void { $this->assertResult($this->matches, Arsse::$db->feedMatchLatest(1, 2)); } - #[CoversMethod(Database::class, "feedMatchIds")] + //#[CoversMethod(Database::class, "feedMatchIds")] public function testMatchItemsById(): void { $this->assertResult($this->matches, Arsse::$db->feedMatchIds(1, ['804e517d623390e71497982c77cf6823180342ebcd2e7d5e32da1e55b09dd180','db3e736c2c492f5def5c5da33ddcbea1824040e9ced2142069276b0a6e291a41'])); foreach ($this->matches as $m) { @@ -214,7 +214,7 @@ trait SeriesFeed { } #[DataProvider("provideFilterRules")] - #[CoversMethod(Database::class, "feedRulesGet")] + //#[CoversMethod(Database::class, "feedRulesGet")] public function testGetRules(int $in, array $exp): void { $this->assertSame($exp, Arsse::$db->feedRulesGet($in)); } @@ -229,7 +229,7 @@ trait SeriesFeed { ]; } - #[CoversMethod(Database::class, "feedUpdate")] + //#[CoversMethod(Database::class, "feedUpdate")] public function testUpdateAFeed(): void { // update a valid feed with both new and changed items Arsse::$db->feedUpdate(1); @@ -271,25 +271,25 @@ trait SeriesFeed { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "feedUpdate")] + //#[CoversMethod(Database::class, "feedUpdate")] public function testUpdateAMissingFeed(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->feedUpdate(2112); } - #[CoversMethod(Database::class, "feedUpdate")] + //#[CoversMethod(Database::class, "feedUpdate")] public function testUpdateAnInvalidFeed(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->feedUpdate(-1); } - #[CoversMethod(Database::class, "feedUpdate")] + //#[CoversMethod(Database::class, "feedUpdate")] public function testUpdateAFeedThrowingExceptions(): void { $this->assertException("invalidUrl", "Feed"); Arsse::$db->feedUpdate(3, true); } - #[CoversMethod(Database::class, "feedUpdate")] + //#[CoversMethod(Database::class, "feedUpdate")] public function testUpdateAFeedWithEnclosuresAndCategories(): void { Arsse::$db->feedUpdate(5); $state = $this->primeExpectations($this->data, [ @@ -310,7 +310,7 @@ trait SeriesFeed { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "feedListStale")] + //#[CoversMethod(Database::class, "feedListStale")] public function testListStaleFeeds(): void { $this->assertEquals([1,3,4], Arsse::$db->feedListStale()); Arsse::$db->feedUpdate(3); @@ -318,7 +318,7 @@ trait SeriesFeed { $this->assertEquals([1], Arsse::$db->feedListStale()); } - #[CoversMethod(Database::class, "feedUpdate")] + //#[CoversMethod(Database::class, "feedUpdate")] public function testCheckIconDuringFeedUpdate(): void { Arsse::$db->feedUpdate(6); $state = $this->primeExpectations($this->data, [ @@ -328,7 +328,7 @@ trait SeriesFeed { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "feedUpdate")] + //#[CoversMethod(Database::class, "feedUpdate")] public function testAssignIconDuringFeedUpdate(): void { Arsse::$db->feedUpdate(7); $state = $this->primeExpectations($this->data, [ @@ -339,7 +339,7 @@ trait SeriesFeed { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "feedUpdate")] + //#[CoversMethod(Database::class, "feedUpdate")] public function testChangeIconDuringFeedUpdate(): void { Arsse::$db->feedUpdate(8); $state = $this->primeExpectations($this->data, [ @@ -350,7 +350,7 @@ trait SeriesFeed { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "feedUpdate")] + //#[CoversMethod(Database::class, "feedUpdate")] public function testAddIconDuringFeedUpdate(): void { Arsse::$db->feedUpdate(9); $state = $this->primeExpectations($this->data, [ @@ -362,7 +362,7 @@ trait SeriesFeed { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "feedUpdate")] + //#[CoversMethod(Database::class, "feedUpdate")] public function testUpdateUnmodifiedFeed(): void { $this->markTestIncomplete("FIXME: there is a bug here around calculation of nextFetch date"); $state = $this->primeExpectations($this->data, [ diff --git a/tests/cases/Database/SeriesFolder.php b/tests/cases/Database/SeriesFolder.php index 9d49e8b4..2e2691de 100644 --- a/tests/cases/Database/SeriesFolder.php +++ b/tests/cases/Database/SeriesFolder.php @@ -102,9 +102,9 @@ trait SeriesFolder { unset($this->data); } - #[CoversMethod(Database::class, "folderAdd")] - #[CoversMethod(Database::class, "folderValidateId")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderAdd")] + //#[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testAddARootFolder(): void { $user = "john.doe@example.com"; $folderID = $this->nextID("arsse_folders"); @@ -114,17 +114,17 @@ trait SeriesFolder { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "folderAdd")] - #[CoversMethod(Database::class, "folderValidateId")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderAdd")] + //#[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testAddADuplicateRootFolder(): void { $this->assertException("constraintViolation", "Db", "ExceptionInput"); Arsse::$db->folderAdd("john.doe@example.com", ['name' => "Politics"]); } - #[CoversMethod(Database::class, "folderAdd")] - #[CoversMethod(Database::class, "folderValidateId")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderAdd")] + //#[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testAddANestedFolder(): void { $user = "john.doe@example.com"; $folderID = $this->nextID("arsse_folders"); @@ -134,56 +134,56 @@ trait SeriesFolder { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "folderAdd")] - #[CoversMethod(Database::class, "folderValidateId")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderAdd")] + //#[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testAddANestedFolderToAMissingParent(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->folderAdd("john.doe@example.com", ['name' => "Sociology", 'parent' => 2112]); } - #[CoversMethod(Database::class, "folderAdd")] - #[CoversMethod(Database::class, "folderValidateId")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderAdd")] + //#[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testAddANestedFolderToAnInvalidParent(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->folderAdd("john.doe@example.com", ['name' => "Sociology", 'parent' => "stringFolderId"]); } - #[CoversMethod(Database::class, "folderAdd")] - #[CoversMethod(Database::class, "folderValidateId")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderAdd")] + //#[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "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 } - #[CoversMethod(Database::class, "folderAdd")] - #[CoversMethod(Database::class, "folderValidateId")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderAdd")] + //#[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testAddAFolderWithAMissingName(): void { $this->assertException("missing", "Db", "ExceptionInput"); Arsse::$db->folderAdd("john.doe@example.com", []); } - #[CoversMethod(Database::class, "folderAdd")] - #[CoversMethod(Database::class, "folderValidateId")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderAdd")] + //#[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testAddAFolderWithABlankName(): void { $this->assertException("missing", "Db", "ExceptionInput"); Arsse::$db->folderAdd("john.doe@example.com", ['name' => ""]); } - #[CoversMethod(Database::class, "folderAdd")] - #[CoversMethod(Database::class, "folderValidateId")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderAdd")] + //#[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testAddAFolderWithAWhitespaceName(): void { $this->assertException("whitespace", "Db", "ExceptionInput"); Arsse::$db->folderAdd("john.doe@example.com", ['name' => " "]); } - #[CoversMethod(Database::class, "folderList")] - #[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderList")] + //#[CoversMethod(Database::class, "folderValidateId")] public function testListRootFolders(): void { $exp = [ ['id' => 5, 'name' => "Politics", 'parent' => null, 'children' => 0, 'feeds' => 2], @@ -198,8 +198,8 @@ trait SeriesFolder { $this->assertResult($exp, Arsse::$db->folderList("admin@example.net", null, false)); } - #[CoversMethod(Database::class, "folderList")] - #[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderList")] + //#[CoversMethod(Database::class, "folderValidateId")] public function testListFoldersRecursively(): void { $exp = [ ['id' => 5, 'name' => "Politics", 'parent' => null, 'children' => 0, 'feeds' => 2], @@ -219,21 +219,21 @@ trait SeriesFolder { $this->assertResult($exp, Arsse::$db->folderList("jane.doe@example.com", 4, true)); } - #[CoversMethod(Database::class, "folderList")] - #[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderList")] + //#[CoversMethod(Database::class, "folderValidateId")] public function testListFoldersOfAMissingParent(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->folderList("john.doe@example.com", 2112); } - #[CoversMethod(Database::class, "folderList")] - #[CoversMethod(Database::class, "folderValidateId")] + //#[CoversMethod(Database::class, "folderList")] + //#[CoversMethod(Database::class, "folderValidateId")] public function testListFoldersOfTheWrongOwner(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->folderList("john.doe@example.com", 4); // folder ID 4 belongs to Jane } - #[CoversMethod(Database::class, "folderRemove")] + //#[CoversMethod(Database::class, "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']]); @@ -241,7 +241,7 @@ trait SeriesFolder { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "folderRemove")] + //#[CoversMethod(Database::class, "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']]); @@ -251,25 +251,25 @@ trait SeriesFolder { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "folderRemove")] + //#[CoversMethod(Database::class, "folderRemove")] public function testRemoveAMissingFolder(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->folderRemove("john.doe@example.com", 2112); } - #[CoversMethod(Database::class, "folderRemove")] + //#[CoversMethod(Database::class, "folderRemove")] public function testRemoveAnInvalidFolder(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->folderRemove("john.doe@example.com", -1); } - #[CoversMethod(Database::class, "folderRemove")] + //#[CoversMethod(Database::class, "folderRemove")] public function testRemoveAFolderOfTheWrongOwner(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->folderRemove("john.doe@example.com", 4); // folder ID 4 belongs to Jane } - #[CoversMethod(Database::class, "folderPropertiesGet")] + //#[CoversMethod(Database::class, "folderPropertiesGet")] public function testGetThePropertiesOfAFolder(): void { $exp = [ 'id' => 6, @@ -279,31 +279,31 @@ trait SeriesFolder { $this->assertArraySubset($exp, Arsse::$db->folderPropertiesGet("john.doe@example.com", 6)); } - #[CoversMethod(Database::class, "folderPropertiesGet")] + //#[CoversMethod(Database::class, "folderPropertiesGet")] public function testGetThePropertiesOfAMissingFolder(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesGet("john.doe@example.com", 2112); } - #[CoversMethod(Database::class, "folderPropertiesGet")] + //#[CoversMethod(Database::class, "folderPropertiesGet")] public function testGetThePropertiesOfAnInvalidFolder(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesGet("john.doe@example.com", -1); } - #[CoversMethod(Database::class, "folderPropertiesGet")] + //#[CoversMethod(Database::class, "folderPropertiesGet")] public function testGetThePropertiesOfAFolderOfTheWrongOwner(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesGet("john.doe@example.com", 4); // folder ID 4 belongs to Jane } - #[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] public function testMakeNoChangesToAFolder(): void { $this->assertFalse(Arsse::$db->folderPropertiesSet("john.doe@example.com", 6, [])); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testRenameAFolder(): void { $this->assertTrue(Arsse::$db->folderPropertiesSet("john.doe@example.com", 6, ['name' => "Opinion"])); $state = $this->primeExpectations($this->data, ['arsse_folders' => ['id','owner', 'parent', 'name']]); @@ -311,35 +311,35 @@ trait SeriesFolder { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testRenameTheRootFolder(): void { $this->assertFalse(Arsse::$db->folderPropertiesSet("john.doe@example.com", null, ['name' => "Opinion"])); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testRenameAFolderToTheEmptyString(): void { $this->assertException("missing", "Db", "ExceptionInput"); $this->assertTrue(Arsse::$db->folderPropertiesSet("john.doe@example.com", 6, ['name' => ""])); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testRenameAFolderToWhitespaceOnly(): void { $this->assertException("whitespace", "Db", "ExceptionInput"); $this->assertTrue(Arsse::$db->folderPropertiesSet("john.doe@example.com", 6, ['name' => " "])); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateName")] public function testRenameAFolderToAnInvalidValue(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); $this->assertTrue(Arsse::$db->folderPropertiesSet("john.doe@example.com", 6, ['name' => []])); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateMove")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateMove")] public function testMoveAFolder(): void { $this->assertTrue(Arsse::$db->folderPropertiesSet("john.doe@example.com", 6, ['parent' => 5])); $state = $this->primeExpectations($this->data, ['arsse_folders' => ['id','owner', 'parent', 'name']]); @@ -347,69 +347,69 @@ trait SeriesFolder { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateMove")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateMove")] public function testMoveTheRootFolder(): void { $this->assertException("circularDependence", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesSet("john.doe@example.com", 0, ['parent' => 1]); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateMove")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateMove")] public function testMoveAFolderToItsDescendant(): void { $this->assertException("circularDependence", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesSet("john.doe@example.com", 1, ['parent' => 3]); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateMove")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateMove")] public function testMoveAFolderToItself(): void { $this->assertException("circularDependence", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesSet("john.doe@example.com", 1, ['parent' => 1]); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateMove")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateMove")] public function testMoveAFolderToAMissingParent(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesSet("john.doe@example.com", 1, ['parent' => 2112]); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateMove")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateMove")] public function testMoveAFolderToAnInvalidParent(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesSet("john.doe@example.com", 1, ['parent' => "ThisFolderDoesNotExist"]); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateMove")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateMove")] public function testCauseAFolderCollision(): void { $this->assertException("constraintViolation", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesSet("john.doe@example.com", 6, ['parent' => null]); } - #[CoversMethod(Database::class, "folderPropertiesSet")] - #[CoversMethod(Database::class, "folderValidateName")] - #[CoversMethod(Database::class, "folderValidateMove")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderValidateName")] + //#[CoversMethod(Database::class, "folderValidateMove")] public function testCauseACompoundFolderCollision(): void { $this->assertException("constraintViolation", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesSet("john.doe@example.com", 3, ['parent' => null, 'name' => "Technology"]); } - #[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] public function testSetThePropertiesOfAMissingFolder(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesSet("john.doe@example.com", 2112, ['parent' => null]); } - #[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] public function testSetThePropertiesOfAnInvalidFolder(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesSet("john.doe@example.com", -1, ['parent' => null]); } - #[CoversMethod(Database::class, "folderPropertiesSet")] + //#[CoversMethod(Database::class, "folderPropertiesSet")] public function testSetThePropertiesOfAFolderForTheWrongOwner(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->folderPropertiesSet("john.doe@example.com", 4, ['parent' => null]); // folder ID 4 belongs to Jane diff --git a/tests/cases/Database/SeriesIcon.php b/tests/cases/Database/SeriesIcon.php index 2ccf2771..d9c594d3 100644 --- a/tests/cases/Database/SeriesIcon.php +++ b/tests/cases/Database/SeriesIcon.php @@ -86,7 +86,7 @@ trait SeriesIcon { unset($this->data); } - #[CoversMethod(Database::class, "iconList")] + //#[CoversMethod(Database::class, "iconList")] public function testListTheIconsOfAUser() { $exp = [ ['id' => 1,'url' => 'http://localhost:8000/Icon/PNG', 'type' => 'image/png', 'data' => base64_decode("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMjHxIGmVAAAADUlEQVQYV2NgYGBgAAAABQABijPjAAAAAABJRU5ErkJggg==")], diff --git a/tests/cases/Database/SeriesLabel.php b/tests/cases/Database/SeriesLabel.php index 67cdbf69..af1bc513 100644 --- a/tests/cases/Database/SeriesLabel.php +++ b/tests/cases/Database/SeriesLabel.php @@ -257,8 +257,8 @@ trait SeriesLabel { unset($this->data, $this->checkLabels, $this->checkMembers, $this->user); } - #[CoversMethod(Database::class, "labelAdd")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelAdd")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testAddALabel(): void { $user = "john.doe@example.com"; $labelID = $this->nextID("arsse_labels"); @@ -268,35 +268,35 @@ trait SeriesLabel { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelAdd")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelAdd")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testAddADuplicateLabel(): void { $this->assertException("constraintViolation", "Db", "ExceptionInput"); Arsse::$db->labelAdd("john.doe@example.com", ['name' => "Interesting"]); } - #[CoversMethod(Database::class, "labelAdd")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelAdd")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testAddALabelWithAMissingName(): void { $this->assertException("missing", "Db", "ExceptionInput"); Arsse::$db->labelAdd("john.doe@example.com", []); } - #[CoversMethod(Database::class, "labelAdd")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelAdd")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testAddALabelWithABlankName(): void { $this->assertException("missing", "Db", "ExceptionInput"); Arsse::$db->labelAdd("john.doe@example.com", ['name' => ""]); } - #[CoversMethod(Database::class, "labelAdd")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelAdd")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testAddALabelWithAWhitespaceName(): void { $this->assertException("whitespace", "Db", "ExceptionInput"); Arsse::$db->labelAdd("john.doe@example.com", ['name' => " "]); } - #[CoversMethod(Database::class, "labelList")] + //#[CoversMethod(Database::class, "labelList")] public function testListLabels(): void { $exp = [ ['id' => 2, 'name' => "Fascinating", 'articles' => 3, 'read' => 1], @@ -312,8 +312,8 @@ trait SeriesLabel { $this->assertResult($exp, Arsse::$db->labelList("jane.doe@example.com", false)); } - #[CoversMethod(Database::class, "labelRemove")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelRemove")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testRemoveALabel(): void { $this->assertTrue(Arsse::$db->labelRemove("john.doe@example.com", 1)); $state = $this->primeExpectations($this->data, $this->checkLabels); @@ -321,8 +321,8 @@ trait SeriesLabel { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelRemove")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelRemove")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testRemoveALabelByName(): void { $this->assertTrue(Arsse::$db->labelRemove("john.doe@example.com", "Interesting", true)); $state = $this->primeExpectations($this->data, $this->checkLabels); @@ -330,36 +330,36 @@ trait SeriesLabel { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelRemove")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelRemove")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testRemoveAMissingLabel(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->labelRemove("john.doe@example.com", 2112); } - #[CoversMethod(Database::class, "labelRemove")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelRemove")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testRemoveAnInvalidLabel(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->labelRemove("john.doe@example.com", -1); } - #[CoversMethod(Database::class, "labelRemove")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelRemove")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testRemoveAnInvalidLabelByName(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->labelRemove("john.doe@example.com", [], true); } - #[CoversMethod(Database::class, "labelRemove")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelRemove")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testRemoveALabelOfTheWrongOwner(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->labelRemove("john.doe@example.com", 3); // label ID 3 belongs to Jane } - #[CoversMethod(Database::class, "labelPropertiesGet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelPropertiesGet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testGetThePropertiesOfALabel(): void { $exp = [ 'id' => 2, @@ -371,44 +371,44 @@ trait SeriesLabel { $this->assertArraySubset($exp, Arsse::$db->labelPropertiesGet("john.doe@example.com", "Fascinating", true)); } - #[CoversMethod(Database::class, "labelPropertiesGet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelPropertiesGet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testGetThePropertiesOfAMissingLabel(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->labelPropertiesGet("john.doe@example.com", 2112); } - #[CoversMethod(Database::class, "labelPropertiesGet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelPropertiesGet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testGetThePropertiesOfAnInvalidLabel(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->labelPropertiesGet("john.doe@example.com", -1); } - #[CoversMethod(Database::class, "labelPropertiesGet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelPropertiesGet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testGetThePropertiesOfAnInvalidLabelByName(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->labelPropertiesGet("john.doe@example.com", [], true); } - #[CoversMethod(Database::class, "labelPropertiesGet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelPropertiesGet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testGetThePropertiesOfALabelOfTheWrongOwner(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->labelPropertiesGet("john.doe@example.com", 3); // label ID 3 belongs to Jane } - #[CoversMethod(Database::class, "labelPropertiesSet")] - #[CoversMethod(Database::class, "labelValidateId")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelPropertiesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testMakeNoChangesToALabel(): void { $this->assertFalse(Arsse::$db->labelPropertiesSet("john.doe@example.com", 1, [])); } - #[CoversMethod(Database::class, "labelPropertiesSet")] - #[CoversMethod(Database::class, "labelValidateId")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelPropertiesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testRenameALabel(): void { $this->assertTrue(Arsse::$db->labelPropertiesSet("john.doe@example.com", 1, ['name' => "Curious"])); $state = $this->primeExpectations($this->data, $this->checkLabels); @@ -416,9 +416,9 @@ trait SeriesLabel { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelPropertiesSet")] - #[CoversMethod(Database::class, "labelValidateId")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelPropertiesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testRenameALabelByName(): void { $this->assertTrue(Arsse::$db->labelPropertiesSet("john.doe@example.com", "Interesting", ['name' => "Curious"], true)); $state = $this->primeExpectations($this->data, $this->checkLabels); @@ -426,72 +426,72 @@ trait SeriesLabel { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelPropertiesSet")] - #[CoversMethod(Database::class, "labelValidateId")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelPropertiesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testRenameALabelToTheEmptyString(): void { $this->assertException("missing", "Db", "ExceptionInput"); $this->assertTrue(Arsse::$db->labelPropertiesSet("john.doe@example.com", 1, ['name' => ""])); } - #[CoversMethod(Database::class, "labelPropertiesSet")] - #[CoversMethod(Database::class, "labelValidateId")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelPropertiesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testRenameALabelToWhitespaceOnly(): void { $this->assertException("whitespace", "Db", "ExceptionInput"); $this->assertTrue(Arsse::$db->labelPropertiesSet("john.doe@example.com", 1, ['name' => " "])); } - #[CoversMethod(Database::class, "labelPropertiesSet")] - #[CoversMethod(Database::class, "labelValidateId")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelPropertiesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testRenameALabelToAnInvalidValue(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); $this->assertTrue(Arsse::$db->labelPropertiesSet("john.doe@example.com", 1, ['name' => []])); } - #[CoversMethod(Database::class, "labelPropertiesSet")] - #[CoversMethod(Database::class, "labelValidateId")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelPropertiesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testCauseALabelCollision(): void { $this->assertException("constraintViolation", "Db", "ExceptionInput"); Arsse::$db->labelPropertiesSet("john.doe@example.com", 1, ['name' => "Fascinating"]); } - #[CoversMethod(Database::class, "labelPropertiesSet")] - #[CoversMethod(Database::class, "labelValidateId")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelPropertiesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testSetThePropertiesOfAMissingLabel(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->labelPropertiesSet("john.doe@example.com", 2112, ['name' => "Exciting"]); } - #[CoversMethod(Database::class, "labelPropertiesSet")] - #[CoversMethod(Database::class, "labelValidateId")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelPropertiesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testSetThePropertiesOfAnInvalidLabel(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->labelPropertiesSet("john.doe@example.com", -1, ['name' => "Exciting"]); } - #[CoversMethod(Database::class, "labelPropertiesSet")] - #[CoversMethod(Database::class, "labelValidateId")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelPropertiesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testSetThePropertiesOfAnInvalidLabelByName(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->labelPropertiesSet("john.doe@example.com", [], ['name' => "Exciting"], true); } - #[CoversMethod(Database::class, "labelPropertiesSet")] - #[CoversMethod(Database::class, "labelValidateId")] - #[CoversMethod(Database::class, "labelValidateName")] + //#[CoversMethod(Database::class, "labelPropertiesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelValidateName")] public function testSetThePropertiesOfALabelForTheWrongOwner(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->labelPropertiesSet("john.doe@example.com", 3, ['name' => "Exciting"]); // label ID 3 belongs to Jane } - #[CoversMethod(Database::class, "labelArticlesGet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelArticlesGet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testListLabelledArticles(): void { $exp = [1,19]; $this->assertEquals($exp, Arsse::$db->labelArticlesGet("john.doe@example.com", 1)); @@ -504,22 +504,22 @@ trait SeriesLabel { $this->assertEquals($exp, Arsse::$db->labelArticlesGet("john.doe@example.com", "Lonely", true)); } - #[CoversMethod(Database::class, "labelArticlesGet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelArticlesGet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testListLabelledArticlesForAMissingLabel(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->labelArticlesGet("john.doe@example.com", 3); } - #[CoversMethod(Database::class, "labelArticlesGet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelArticlesGet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testListLabelledArticlesForAnInvalidLabel(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->labelArticlesGet("john.doe@example.com", -1); } - #[CoversMethod(Database::class, "labelArticlesSet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelArticlesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testApplyALabelToArticles(): void { Arsse::$db->labelArticlesSet("john.doe@example.com", 1, (new Context)->articles([2,5])); $state = $this->primeExpectations($this->data, $this->checkMembers); @@ -528,8 +528,8 @@ trait SeriesLabel { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelArticlesSet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelArticlesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testClearALabelFromArticles(): void { Arsse::$db->labelArticlesSet("john.doe@example.com", 1, (new Context)->articles([1,5]), Database::ASSOC_REMOVE); $state = $this->primeExpectations($this->data, $this->checkMembers); @@ -537,8 +537,8 @@ trait SeriesLabel { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelArticlesSet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelArticlesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testApplyALabelToArticlesByName(): void { Arsse::$db->labelArticlesSet("john.doe@example.com", "Interesting", (new Context)->articles([2,5]), Database::ASSOC_ADD, true); $state = $this->primeExpectations($this->data, $this->checkMembers); @@ -547,8 +547,8 @@ trait SeriesLabel { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelArticlesSet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelArticlesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testClearALabelFromArticlesByName(): void { Arsse::$db->labelArticlesSet("john.doe@example.com", "Interesting", (new Context)->articles([1,5]), Database::ASSOC_REMOVE, true); $state = $this->primeExpectations($this->data, $this->checkMembers); @@ -556,24 +556,24 @@ trait SeriesLabel { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelArticlesSet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelArticlesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testApplyALabelToNoArticles(): void { Arsse::$db->labelArticlesSet("john.doe@example.com", 1, (new Context)->articles([10000])); $state = $this->primeExpectations($this->data, $this->checkMembers); $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelArticlesSet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelArticlesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testClearALabelFromNoArticles(): void { Arsse::$db->labelArticlesSet("john.doe@example.com", 1, (new Context)->articles([10000]), Database::ASSOC_REMOVE); $state = $this->primeExpectations($this->data, $this->checkMembers); $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelArticlesSet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelArticlesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testReplaceArticlesOfALabel(): void { Arsse::$db->labelArticlesSet("john.doe@example.com", 1, (new Context)->articles([2,5]), Database::ASSOC_REPLACE); $state = $this->primeExpectations($this->data, $this->checkMembers); @@ -584,8 +584,8 @@ trait SeriesLabel { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "labelArticlesSet")] - #[CoversMethod(Database::class, "labelValidateId")] + //#[CoversMethod(Database::class, "labelArticlesSet")] + //#[CoversMethod(Database::class, "labelValidateId")] public function testPurgeArticlesOfALabel(): void { Arsse::$db->labelArticlesSet("john.doe@example.com", 1, (new Context)->articles([10000]), Database::ASSOC_REPLACE); $state = $this->primeExpectations($this->data, $this->checkMembers); diff --git a/tests/cases/Database/SeriesMeta.php b/tests/cases/Database/SeriesMeta.php index b661e0d7..e9a56230 100644 --- a/tests/cases/Database/SeriesMeta.php +++ b/tests/cases/Database/SeriesMeta.php @@ -38,7 +38,7 @@ trait SeriesMeta { unset($this->data); } - #[CoversMethod(Database::class, "metaSet")] + //#[CoversMethod(Database::class, "metaSet")] public function testAddANewValue(): void { $this->assertTrue(Arsse::$db->metaSet("favourite", "Cygnus X-1")); $state = $this->primeExpectations($this->data, ['arsse_meta' => ['key','value']]); @@ -46,7 +46,7 @@ trait SeriesMeta { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "metaSet")] + //#[CoversMethod(Database::class, "metaSet")] public function testAddANewTypedValue(): void { $this->assertTrue(Arsse::$db->metaSet("answer", 42, "int")); $this->assertTrue(Arsse::$db->metaSet("true", true, "bool")); @@ -60,7 +60,7 @@ trait SeriesMeta { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "metaSet")] + //#[CoversMethod(Database::class, "metaSet")] public function testChangeAnExistingValue(): void { $this->assertTrue(Arsse::$db->metaSet("album", "Hemispheres")); $state = $this->primeExpectations($this->data, ['arsse_meta' => ['key','value']]); @@ -68,7 +68,7 @@ trait SeriesMeta { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "metaRemove")] + //#[CoversMethod(Database::class, "metaRemove")] public function testRemoveAValue(): void { $this->assertTrue(Arsse::$db->metaRemove("album")); $this->assertFalse(Arsse::$db->metaRemove("album")); @@ -77,7 +77,7 @@ trait SeriesMeta { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "metaGet")] + //#[CoversMethod(Database::class, "metaGet")] public function testRetrieveAValue(): void { $this->assertSame("".Database::SCHEMA_VERSION, Arsse::$db->metaGet("schema_version")); $this->assertSame("A Farewell to Kings", Arsse::$db->metaGet("album")); diff --git a/tests/cases/Database/SeriesMiscellany.php b/tests/cases/Database/SeriesMiscellany.php index 45de2eb7..2e3f88e4 100644 --- a/tests/cases/Database/SeriesMiscellany.php +++ b/tests/cases/Database/SeriesMiscellany.php @@ -22,18 +22,18 @@ trait SeriesMiscellany { protected function tearDownSeriesMiscellany(): void { } - #[CoversMethod(Database::class, "__construct")] - #[CoversMethod(Database::class, "driverSchemaVersion")] - #[CoversMethod(Database::class, "driverSchemaUpdate")] + //#[CoversMethod(Database::class, "__construct")] + //#[CoversMethod(Database::class, "driverSchemaVersion")] + //#[CoversMethod(Database::class, "driverSchemaUpdate")] public function testInitializeDatabase(): void { static::dbRaze(static::$drv); $d = new Database(true); $this->assertSame(Database::SCHEMA_VERSION, $d->driverSchemaVersion()); } - #[CoversMethod(Database::class, "__construct")] - #[CoversMethod(Database::class, "driverSchemaVersion")] - #[CoversMethod(Database::class, "driverSchemaUpdate")] + //#[CoversMethod(Database::class, "__construct")] + //#[CoversMethod(Database::class, "driverSchemaVersion")] + //#[CoversMethod(Database::class, "driverSchemaUpdate")] public function testManuallyInitializeDatabase(): void { static::dbRaze(static::$drv); $d = new Database(false); @@ -43,12 +43,12 @@ trait SeriesMiscellany { $this->assertFalse($d->driverSchemaUpdate()); } - #[CoversMethod(Database::class, "driverCharsetAcceptable")] + //#[CoversMethod(Database::class, "driverCharsetAcceptable")] public function testCheckCharacterSetAcceptability(): void { $this->assertIsBool(Arsse::$db->driverCharsetAcceptable()); } - #[CoversMethod(Database::class, "driverMaintenance")] + //#[CoversMethod(Database::class, "driverMaintenance")] public function testPerformMaintenance(): void { $this->assertTrue(Arsse::$db->driverMaintenance()); } diff --git a/tests/cases/Database/SeriesSession.php b/tests/cases/Database/SeriesSession.php index bd20cfb1..6bc79351 100644 --- a/tests/cases/Database/SeriesSession.php +++ b/tests/cases/Database/SeriesSession.php @@ -58,8 +58,8 @@ trait SeriesSession { unset($this->data); } - #[CoversMethod(Database::class, "sessionResume")] - #[CoversMethod(Database::class, "sessionExpiringSoon")] + //#[CoversMethod(Database::class, "sessionResume")] + //#[CoversMethod(Database::class, "sessionExpiringSoon")] public function testResumeAValidSession(): void { $exp1 = [ 'id' => "80fa94c1a11f11e78667001e673b2560", @@ -78,28 +78,28 @@ trait SeriesSession { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "sessionResume")] - #[CoversMethod(Database::class, "sessionExpiringSoon")] + //#[CoversMethod(Database::class, "sessionResume")] + //#[CoversMethod(Database::class, "sessionExpiringSoon")] public function testResumeAMissingSession(): void { $this->assertException("invalid", "User", "ExceptionSession"); Arsse::$db->sessionResume("thisSessionDoesNotExist"); } - #[CoversMethod(Database::class, "sessionResume")] - #[CoversMethod(Database::class, "sessionExpiringSoon")] + //#[CoversMethod(Database::class, "sessionResume")] + //#[CoversMethod(Database::class, "sessionExpiringSoon")] public function testResumeAnExpiredSession(): void { $this->assertException("invalid", "User", "ExceptionSession"); Arsse::$db->sessionResume("27c6de8da13311e78667001e673b2560"); } - #[CoversMethod(Database::class, "sessionResume")] - #[CoversMethod(Database::class, "sessionExpiringSoon")] + //#[CoversMethod(Database::class, "sessionResume")] + //#[CoversMethod(Database::class, "sessionExpiringSoon")] public function testResumeAStaleSession(): void { $this->assertException("invalid", "User", "ExceptionSession"); Arsse::$db->sessionResume("ab3b3eb8a13311e78667001e673b2560"); } - #[CoversMethod(Database::class, "sessionCreate")] + //#[CoversMethod(Database::class, "sessionCreate")] public function testCreateASession(): void { $user = "jane.doe@example.com"; $id = Arsse::$db->sessionCreate($user); @@ -109,7 +109,7 @@ trait SeriesSession { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "sessionDestroy")] + //#[CoversMethod(Database::class, "sessionDestroy")] public function testDestroyASession(): void { $user = "jane.doe@example.com"; $id = "80fa94c1a11f11e78667001e673b2560"; @@ -121,7 +121,7 @@ trait SeriesSession { $this->assertFalse(Arsse::$db->sessionDestroy($user, $id)); } - #[CoversMethod(Database::class, "sessionDestroy")] + //#[CoversMethod(Database::class, "sessionDestroy")] public function testDestroyAllSessions(): void { $user = "jane.doe@example.com"; $this->assertTrue(Arsse::$db->sessionDestroy($user)); @@ -132,7 +132,7 @@ trait SeriesSession { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "sessionDestroy")] + //#[CoversMethod(Database::class, "sessionDestroy")] public function testDestroyASessionForTheWrongUser(): void { $user = "john.doe@example.com"; $id = "80fa94c1a11f11e78667001e673b2560"; diff --git a/tests/cases/Database/SeriesSubscription.php b/tests/cases/Database/SeriesSubscription.php index e9570b3d..52465f25 100644 --- a/tests/cases/Database/SeriesSubscription.php +++ b/tests/cases/Database/SeriesSubscription.php @@ -207,8 +207,8 @@ trait SeriesSubscription { unset($this->data, $this->user); } - #[CoversMethod(Database::class, "subscriptionAdd")] - #[CoversMethod(Database::class, "feedAdd")] + //#[CoversMethod(Database::class, "subscriptionAdd")] + //#[CoversMethod(Database::class, "feedAdd")] public function testAddASubscriptionToAnExistingFeed(): void { $url = "http://example.com/feed1"; $subID = $this->nextID("arsse_subscriptions"); @@ -224,8 +224,8 @@ trait SeriesSubscription { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "subscriptionAdd")] - #[CoversMethod(Database::class, "feedAdd")] + //#[CoversMethod(Database::class, "subscriptionAdd")] + //#[CoversMethod(Database::class, "feedAdd")] public function testAddASubscriptionToANewFeed(): void { $url = "http://example.org/feed1"; $feedID = $this->nextID("arsse_feeds"); @@ -243,8 +243,8 @@ trait SeriesSubscription { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "subscriptionAdd")] - #[CoversMethod(Database::class, "feedAdd")] + //#[CoversMethod(Database::class, "subscriptionAdd")] + //#[CoversMethod(Database::class, "feedAdd")] public function testAddASubscriptionToANewFeedViaDiscovery(): void { $url = "http://localhost:8000/Feed/Discovery/Valid"; $discovered = "http://localhost:8000/Feed/Discovery/Feed"; @@ -263,8 +263,8 @@ trait SeriesSubscription { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "subscriptionAdd")] - #[CoversMethod(Database::class, "feedAdd")] + //#[CoversMethod(Database::class, "subscriptionAdd")] + //#[CoversMethod(Database::class, "feedAdd")] public function testAddASubscriptionToAnInvalidFeed(): void { $url = "http://example.org/feed1"; $feedID = $this->nextID("arsse_feeds"); @@ -283,24 +283,24 @@ trait SeriesSubscription { } } - #[CoversMethod(Database::class, "subscriptionAdd")] - #[CoversMethod(Database::class, "feedAdd")] + //#[CoversMethod(Database::class, "subscriptionAdd")] + //#[CoversMethod(Database::class, "feedAdd")] public function testAddADuplicateSubscription(): void { $url = "http://example.com/feed2"; $this->assertException("constraintViolation", "Db", "ExceptionInput"); Arsse::$db->subscriptionAdd($this->user, $url); } - #[CoversMethod(Database::class, "subscriptionAdd")] - #[CoversMethod(Database::class, "feedAdd")] + //#[CoversMethod(Database::class, "subscriptionAdd")] + //#[CoversMethod(Database::class, "feedAdd")] public function testAddADuplicateSubscriptionWithEquivalentUrl(): void { $url = "http://EXAMPLE.COM/feed2"; $this->assertException("constraintViolation", "Db", "ExceptionInput"); Arsse::$db->subscriptionAdd($this->user, $url); } - #[CoversMethod(Database::class, "subscriptionAdd")] - #[CoversMethod(Database::class, "feedAdd")] + //#[CoversMethod(Database::class, "subscriptionAdd")] + //#[CoversMethod(Database::class, "feedAdd")] public function testAddADuplicateSubscriptionViaRedirection(): void { $url = "http://localhost:8000/Feed/Parsing/Valid"; Arsse::$db->subscriptionAdd($this->user, $url); @@ -309,7 +309,7 @@ trait SeriesSubscription { $this->assertSame($subID, Arsse::$db->subscriptionAdd($this->user, $url)); } - #[CoversMethod(Database::class, "subscriptionRemove")] + //#[CoversMethod(Database::class, "subscriptionRemove")] public function testRemoveASubscription(): void { $this->assertTrue(Arsse::$db->subscriptionRemove($this->user, 1)); $state = $this->primeExpectations($this->data, [ @@ -320,27 +320,27 @@ trait SeriesSubscription { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "subscriptionRemove")] + //#[CoversMethod(Database::class, "subscriptionRemove")] public function testRemoveAMissingSubscription(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->subscriptionRemove($this->user, 2112); } - #[CoversMethod(Database::class, "subscriptionRemove")] + //#[CoversMethod(Database::class, "subscriptionRemove")] public function testRemoveAnInvalidSubscription(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->subscriptionRemove($this->user, -1); } - #[CoversMethod(Database::class, "subscriptionRemove")] + //#[CoversMethod(Database::class, "subscriptionRemove")] public function testRemoveASubscriptionForTheWrongOwner(): void { $this->user = "jane.doe@example.com"; $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->subscriptionRemove($this->user, 1); } - #[CoversMethod(Database::class, "subscriptionList")] - #[CoversMethod(Database::class, "subscriptionPropertiesGet")] + //#[CoversMethod(Database::class, "subscriptionList")] + //#[CoversMethod(Database::class, "subscriptionPropertiesGet")] public function testListSubscriptions(): void { $exp = [ [ @@ -401,7 +401,7 @@ trait SeriesSubscription { $this->assertResult($exp, Arsse::$db->subscriptionList("jill.doe@example.com")); } - #[CoversMethod(Database::class, "subscriptionList")] + //#[CoversMethod(Database::class, "subscriptionList")] public function testListSubscriptionsInAFolder(): void { $exp = [ [ @@ -417,7 +417,7 @@ trait SeriesSubscription { $this->assertResult($exp, Arsse::$db->subscriptionList($this->user, null, false)); } - #[CoversMethod(Database::class, "subscriptionList")] + //#[CoversMethod(Database::class, "subscriptionList")] public function testListSubscriptionsWithRecursion(): void { $exp = [ [ @@ -433,39 +433,39 @@ trait SeriesSubscription { $this->assertResult($exp, Arsse::$db->subscriptionList($this->user, 2)); } - #[CoversMethod(Database::class, "subscriptionList")] + //#[CoversMethod(Database::class, "subscriptionList")] public function testListSubscriptionsInAMissingFolder(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->subscriptionList($this->user, 4); } - #[CoversMethod(Database::class, "subscriptionCount")] + //#[CoversMethod(Database::class, "subscriptionCount")] public function testCountSubscriptions(): void { $this->assertSame(3, Arsse::$db->subscriptionCount($this->user)); $this->assertSame(1, Arsse::$db->subscriptionCount($this->user, 2)); } - #[CoversMethod(Database::class, "subscriptionCount")] + //#[CoversMethod(Database::class, "subscriptionCount")] public function testCountSubscriptionsInAMissingFolder(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->subscriptionCount($this->user, 4); } - #[CoversMethod(Database::class, "subscriptionPropertiesGet")] + //#[CoversMethod(Database::class, "subscriptionPropertiesGet")] public function testGetThePropertiesOfAMissingSubscription(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->subscriptionPropertiesGet($this->user, 2112); } - #[CoversMethod(Database::class, "subscriptionPropertiesGet")] + //#[CoversMethod(Database::class, "subscriptionPropertiesGet")] public function testGetThePropertiesOfAnInvalidSubscription(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->subscriptionPropertiesGet($this->user, -1); } - #[CoversMethod(Database::class, "subscriptionPropertiesSet")] - #[CoversMethod(Database::class, "subscriptionValidateId")] - #[CoversMethod(Database::class, "subscriptionRulesApply")] + //#[CoversMethod(Database::class, "subscriptionPropertiesSet")] + //#[CoversMethod(Database::class, "subscriptionValidateId")] + //#[CoversMethod(Database::class, "subscriptionRulesApply")] public function testSetThePropertiesOfASubscription(): void { Arsse::$db->subscriptionPropertiesSet($this->user, 1, [ 'title' => "Ook Ook", @@ -494,25 +494,25 @@ trait SeriesSubscription { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "subscriptionPropertiesSet")] - #[CoversMethod(Database::class, "subscriptionValidateId")] - #[CoversMethod(Database::class, "subscriptionRulesApply")] + //#[CoversMethod(Database::class, "subscriptionPropertiesSet")] + //#[CoversMethod(Database::class, "subscriptionValidateId")] + //#[CoversMethod(Database::class, "subscriptionRulesApply")] public function testMoveASubscriptionToAMissingFolder(): void { $this->assertException("idMissing", "Db", "ExceptionInput"); Arsse::$db->subscriptionPropertiesSet($this->user, 1, ['folder' => 4]); } - #[CoversMethod(Database::class, "subscriptionPropertiesSet")] - #[CoversMethod(Database::class, "subscriptionValidateId")] - #[CoversMethod(Database::class, "subscriptionRulesApply")] + //#[CoversMethod(Database::class, "subscriptionPropertiesSet")] + //#[CoversMethod(Database::class, "subscriptionValidateId")] + //#[CoversMethod(Database::class, "subscriptionRulesApply")] public function testMoveASubscriptionToTheRootFolder(): void { $this->assertTrue(Arsse::$db->subscriptionPropertiesSet($this->user, 3, ['folder' => null])); } #[DataProvider("provideInvalidSubscriptionProperties")] - #[CoversMethod(Database::class, "subscriptionPropertiesSet")] - #[CoversMethod(Database::class, "subscriptionValidateId")] - #[CoversMethod(Database::class, "subscriptionRulesApply")] + //#[CoversMethod(Database::class, "subscriptionPropertiesSet")] + //#[CoversMethod(Database::class, "subscriptionValidateId")] + //#[CoversMethod(Database::class, "subscriptionRulesApply")] public function testSetThePropertiesOfASubscriptionToInvalidValues(array $data, string $exp): void { $this->assertException($exp, "Db", "ExceptionInput"); Arsse::$db->subscriptionPropertiesSet($this->user, 1, $data); @@ -530,30 +530,30 @@ trait SeriesSubscription { ]; } - #[CoversMethod(Database::class, "subscriptionPropertiesSet")] - #[CoversMethod(Database::class, "subscriptionValidateId")] - #[CoversMethod(Database::class, "subscriptionRulesApply")] + //#[CoversMethod(Database::class, "subscriptionPropertiesSet")] + //#[CoversMethod(Database::class, "subscriptionValidateId")] + //#[CoversMethod(Database::class, "subscriptionRulesApply")] public function testRenameASubscriptionToZero(): void { $this->assertTrue(Arsse::$db->subscriptionPropertiesSet($this->user, 1, ['title' => 0])); } - #[CoversMethod(Database::class, "subscriptionPropertiesSet")] - #[CoversMethod(Database::class, "subscriptionValidateId")] - #[CoversMethod(Database::class, "subscriptionRulesApply")] + //#[CoversMethod(Database::class, "subscriptionPropertiesSet")] + //#[CoversMethod(Database::class, "subscriptionValidateId")] + //#[CoversMethod(Database::class, "subscriptionRulesApply")] public function testSetThePropertiesOfAMissingSubscription(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->subscriptionPropertiesSet($this->user, 2112, ['folder' => null]); } - #[CoversMethod(Database::class, "subscriptionPropertiesSet")] - #[CoversMethod(Database::class, "subscriptionValidateId")] - #[CoversMethod(Database::class, "subscriptionRulesApply")] + //#[CoversMethod(Database::class, "subscriptionPropertiesSet")] + //#[CoversMethod(Database::class, "subscriptionValidateId")] + //#[CoversMethod(Database::class, "subscriptionRulesApply")] public function testSetThePropertiesOfAnInvalidSubscription(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->subscriptionPropertiesSet($this->user, -1, ['folder' => null]); } - #[CoversMethod(Database::class, "subscriptionIcon")] + //#[CoversMethod(Database::class, "subscriptionIcon")] public function testRetrieveTheFaviconOfASubscription(): void { $exp = "http://example.com/favicon.ico"; $this->assertSame($exp, Arsse::$db->subscriptionIcon(null, 1)['url']); @@ -561,13 +561,13 @@ trait SeriesSubscription { $this->assertSame(null, Arsse::$db->subscriptionIcon(null, 6)); } - #[CoversMethod(Database::class, "subscriptionIcon")] + //#[CoversMethod(Database::class, "subscriptionIcon")] public function testRetrieveTheFaviconOfAMissingSubscription(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->subscriptionIcon(null, -2112); } - #[CoversMethod(Database::class, "subscriptionIcon")] + //#[CoversMethod(Database::class, "subscriptionIcon")] public function testRetrieveTheFaviconOfASubscriptionWithUser(): void { $exp = "http://example.com/favicon.ico"; $user = "john.doe@example.com"; @@ -577,14 +577,14 @@ trait SeriesSubscription { $this->assertSame($exp, Arsse::$db->subscriptionIcon($user, 2)['url']); } - #[CoversMethod(Database::class, "subscriptionIcon")] + //#[CoversMethod(Database::class, "subscriptionIcon")] public function testRetrieveTheFaviconOfASubscriptionOfTheWrongUser(): void { $user = "john.doe@example.com"; $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->subscriptionIcon($user, 2); } - #[CoversMethod(Database::class, "subscriptionTagsGet")] + //#[CoversMethod(Database::class, "subscriptionTagsGet")] public function testListTheTagsOfASubscription(): void { $this->assertEquals([1,2], Arsse::$db->subscriptionTagsGet("john.doe@example.com", 1)); $this->assertEquals([2], Arsse::$db->subscriptionTagsGet("john.doe@example.com", 3)); @@ -592,28 +592,28 @@ trait SeriesSubscription { $this->assertEquals(["Fascinating"], Arsse::$db->subscriptionTagsGet("john.doe@example.com", 3, true)); } - #[CoversMethod(Database::class, "subscriptionTagsGet")] + //#[CoversMethod(Database::class, "subscriptionTagsGet")] public function testListTheTagsOfAMissingSubscription(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->subscriptionTagsGet($this->user, 101); } - #[CoversMethod(Database::class, "subscriptionRefreshed")] + //#[CoversMethod(Database::class, "subscriptionRefreshed")] public function testGetRefreshTimeOfASubscription(): void { $user = "john.doe@example.com"; $this->assertTime(strtotime("now + 1 hour"), Arsse::$db->subscriptionRefreshed($user)); $this->assertTime(strtotime("now - 1 hour"), Arsse::$db->subscriptionRefreshed($user, 1)); } - #[CoversMethod(Database::class, "subscriptionRefreshed")] + //#[CoversMethod(Database::class, "subscriptionRefreshed")] public function testGetRefreshTimeOfAMissingSubscription(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); $this->assertTime(strtotime("now - 1 hour"), Arsse::$db->subscriptionRefreshed("john.doe@example.com", 2)); } - #[CoversMethod(Database::class, "subscriptionPropertiesSet")] - #[CoversMethod(Database::class, "subscriptionValidateId")] - #[CoversMethod(Database::class, "subscriptionRulesApply")] + //#[CoversMethod(Database::class, "subscriptionPropertiesSet")] + //#[CoversMethod(Database::class, "subscriptionValidateId")] + //#[CoversMethod(Database::class, "subscriptionRulesApply")] public function testSetTheFilterRulesOfASubscriptionCheckingMarks(): void { Arsse::$db->subscriptionPropertiesSet("jack.doe@example.com", 5, ['keep_rule' => "1|B|3|D", 'block_rule' => "4"]); $state = $this->primeExpectations($this->data, ['arsse_marks' => ['article', 'subscription', 'hidden']]); diff --git a/tests/cases/Database/SeriesTag.php b/tests/cases/Database/SeriesTag.php index 4ad853f2..af2375a8 100644 --- a/tests/cases/Database/SeriesTag.php +++ b/tests/cases/Database/SeriesTag.php @@ -115,8 +115,8 @@ trait SeriesTag { unset($this->data, $this->checkTags, $this->checkMembers, $this->user); } - #[CoversMethod(Database::class, "tagAdd")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagAdd")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testAddATag(): void { $user = "john.doe@example.com"; $tagID = $this->nextID("arsse_tags"); @@ -126,35 +126,35 @@ trait SeriesTag { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagAdd")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagAdd")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testAddADuplicateTag(): void { $this->assertException("constraintViolation", "Db", "ExceptionInput"); Arsse::$db->tagAdd("john.doe@example.com", ['name' => "Interesting"]); } - #[CoversMethod(Database::class, "tagAdd")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagAdd")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testAddATagWithAMissingName(): void { $this->assertException("missing", "Db", "ExceptionInput"); Arsse::$db->tagAdd("john.doe@example.com", []); } - #[CoversMethod(Database::class, "tagAdd")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagAdd")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testAddATagWithABlankName(): void { $this->assertException("missing", "Db", "ExceptionInput"); Arsse::$db->tagAdd("john.doe@example.com", ['name' => ""]); } - #[CoversMethod(Database::class, "tagAdd")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagAdd")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testAddATagWithAWhitespaceName(): void { $this->assertException("whitespace", "Db", "ExceptionInput"); Arsse::$db->tagAdd("john.doe@example.com", ['name' => " "]); } - #[CoversMethod(Database::class, "tagList")] + //#[CoversMethod(Database::class, "tagList")] public function testListTags(): void { $exp = [ ['id' => 2, 'name' => "Fascinating"], @@ -170,8 +170,8 @@ trait SeriesTag { $this->assertResult($exp, Arsse::$db->tagList("jane.doe@example.com", false)); } - #[CoversMethod(Database::class, "tagRemove")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagRemove")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testRemoveATag(): void { $this->assertTrue(Arsse::$db->tagRemove("john.doe@example.com", 1)); $state = $this->primeExpectations($this->data, $this->checkTags); @@ -179,8 +179,8 @@ trait SeriesTag { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagRemove")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagRemove")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testRemoveATagByName(): void { $this->assertTrue(Arsse::$db->tagRemove("john.doe@example.com", "Interesting", true)); $state = $this->primeExpectations($this->data, $this->checkTags); @@ -188,36 +188,36 @@ trait SeriesTag { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagRemove")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagRemove")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testRemoveAMissingTag(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->tagRemove("john.doe@example.com", 2112); } - #[CoversMethod(Database::class, "tagRemove")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagRemove")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testRemoveAnInvalidTag(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->tagRemove("john.doe@example.com", -1); } - #[CoversMethod(Database::class, "tagRemove")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagRemove")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testRemoveAnInvalidTagByName(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->tagRemove("john.doe@example.com", [], true); } - #[CoversMethod(Database::class, "tagRemove")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagRemove")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testRemoveATagOfTheWrongOwner(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->tagRemove("john.doe@example.com", 3); // tag ID 3 belongs to Jane } - #[CoversMethod(Database::class, "tagPropertiesGet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagPropertiesGet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testGetThePropertiesOfATag(): void { $exp = [ 'id' => 2, @@ -227,44 +227,44 @@ trait SeriesTag { $this->assertArraySubset($exp, Arsse::$db->tagPropertiesGet("john.doe@example.com", "Fascinating", true)); } - #[CoversMethod(Database::class, "tagPropertiesGet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagPropertiesGet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testGetThePropertiesOfAMissingTag(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->tagPropertiesGet("john.doe@example.com", 2112); } - #[CoversMethod(Database::class, "tagPropertiesGet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagPropertiesGet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testGetThePropertiesOfAnInvalidTag(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->tagPropertiesGet("john.doe@example.com", -1); } - #[CoversMethod(Database::class, "tagPropertiesGet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagPropertiesGet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testGetThePropertiesOfAnInvalidTagByName(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->tagPropertiesGet("john.doe@example.com", [], true); } - #[CoversMethod(Database::class, "tagPropertiesGet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagPropertiesGet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testGetThePropertiesOfATagOfTheWrongOwner(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->tagPropertiesGet("john.doe@example.com", 3); // tag ID 3 belongs to Jane } - #[CoversMethod(Database::class, "tagPropertiesSet")] - #[CoversMethod(Database::class, "tagValidateId")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagPropertiesSet")] + //#[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testMakeNoChangesToATag(): void { $this->assertFalse(Arsse::$db->tagPropertiesSet("john.doe@example.com", 1, [])); } - #[CoversMethod(Database::class, "tagPropertiesSet")] - #[CoversMethod(Database::class, "tagValidateId")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagPropertiesSet")] + //#[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testRenameATag(): void { $this->assertTrue(Arsse::$db->tagPropertiesSet("john.doe@example.com", 1, ['name' => "Curious"])); $state = $this->primeExpectations($this->data, $this->checkTags); @@ -272,9 +272,9 @@ trait SeriesTag { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagPropertiesSet")] - #[CoversMethod(Database::class, "tagValidateId")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagPropertiesSet")] + //#[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testRenameATagByName(): void { $this->assertTrue(Arsse::$db->tagPropertiesSet("john.doe@example.com", "Interesting", ['name' => "Curious"], true)); $state = $this->primeExpectations($this->data, $this->checkTags); @@ -282,72 +282,72 @@ trait SeriesTag { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagPropertiesSet")] - #[CoversMethod(Database::class, "tagValidateId")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagPropertiesSet")] + //#[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testRenameATagToTheEmptyString(): void { $this->assertException("missing", "Db", "ExceptionInput"); $this->assertTrue(Arsse::$db->tagPropertiesSet("john.doe@example.com", 1, ['name' => ""])); } - #[CoversMethod(Database::class, "tagPropertiesSet")] - #[CoversMethod(Database::class, "tagValidateId")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagPropertiesSet")] + //#[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testRenameATagToWhitespaceOnly(): void { $this->assertException("whitespace", "Db", "ExceptionInput"); $this->assertTrue(Arsse::$db->tagPropertiesSet("john.doe@example.com", 1, ['name' => " "])); } - #[CoversMethod(Database::class, "tagPropertiesSet")] - #[CoversMethod(Database::class, "tagValidateId")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagPropertiesSet")] + //#[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testRenameATagToAnInvalidValue(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); $this->assertTrue(Arsse::$db->tagPropertiesSet("john.doe@example.com", 1, ['name' => []])); } - #[CoversMethod(Database::class, "tagPropertiesSet")] - #[CoversMethod(Database::class, "tagValidateId")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagPropertiesSet")] + //#[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testCauseATagCollision(): void { $this->assertException("constraintViolation", "Db", "ExceptionInput"); Arsse::$db->tagPropertiesSet("john.doe@example.com", 1, ['name' => "Fascinating"]); } - #[CoversMethod(Database::class, "tagPropertiesSet")] - #[CoversMethod(Database::class, "tagValidateId")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagPropertiesSet")] + //#[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testSetThePropertiesOfAMissingTag(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->tagPropertiesSet("john.doe@example.com", 2112, ['name' => "Exciting"]); } - #[CoversMethod(Database::class, "tagPropertiesSet")] - #[CoversMethod(Database::class, "tagValidateId")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagPropertiesSet")] + //#[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testSetThePropertiesOfAnInvalidTag(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->tagPropertiesSet("john.doe@example.com", -1, ['name' => "Exciting"]); } - #[CoversMethod(Database::class, "tagPropertiesSet")] - #[CoversMethod(Database::class, "tagValidateId")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagPropertiesSet")] + //#[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testSetThePropertiesOfAnInvalidTagByName(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->tagPropertiesSet("john.doe@example.com", [], ['name' => "Exciting"], true); } - #[CoversMethod(Database::class, "tagPropertiesSet")] - #[CoversMethod(Database::class, "tagValidateId")] - #[CoversMethod(Database::class, "tagValidateName")] + //#[CoversMethod(Database::class, "tagPropertiesSet")] + //#[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagValidateName")] public function testSetThePropertiesOfATagForTheWrongOwner(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->tagPropertiesSet("john.doe@example.com", 3, ['name' => "Exciting"]); // tag ID 3 belongs to Jane } - #[CoversMethod(Database::class, "tagSubscriptionsGet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagSubscriptionsGet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testListTaggedSubscriptions(): void { $exp = [1,5]; $this->assertEquals($exp, Arsse::$db->tagSubscriptionsGet("john.doe@example.com", 1)); @@ -360,22 +360,22 @@ trait SeriesTag { $this->assertEquals($exp, Arsse::$db->tagSubscriptionsGet("john.doe@example.com", "Lonely", true)); } - #[CoversMethod(Database::class, "tagSubscriptionsGet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagSubscriptionsGet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testListTaggedSubscriptionsForAMissingTag(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->tagSubscriptionsGet("john.doe@example.com", 3); } - #[CoversMethod(Database::class, "tagSubscriptionsGet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagSubscriptionsGet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testListTaggedSubscriptionsForAnInvalidTag(): void { $this->assertException("typeViolation", "Db", "ExceptionInput"); Arsse::$db->tagSubscriptionsGet("john.doe@example.com", -1); } - #[CoversMethod(Database::class, "tagSubscriptionsSet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagSubscriptionsSet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testApplyATagToSubscriptions(): void { Arsse::$db->tagSubscriptionsSet("john.doe@example.com", 1, [3,4]); $state = $this->primeExpectations($this->data, $this->checkMembers); @@ -384,8 +384,8 @@ trait SeriesTag { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagSubscriptionsSet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagSubscriptionsSet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testClearATagFromSubscriptions(): void { Arsse::$db->tagSubscriptionsSet("john.doe@example.com", 1, [1,3], Database::ASSOC_REMOVE); $state = $this->primeExpectations($this->data, $this->checkMembers); @@ -393,8 +393,8 @@ trait SeriesTag { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagSubscriptionsSet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagSubscriptionsSet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testApplyATagToSubscriptionsByName(): void { Arsse::$db->tagSubscriptionsSet("john.doe@example.com", "Interesting", [3,4], Database::ASSOC_ADD, true); $state = $this->primeExpectations($this->data, $this->checkMembers); @@ -403,8 +403,8 @@ trait SeriesTag { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagSubscriptionsSet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagSubscriptionsSet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testClearATagFromSubscriptionsByName(): void { Arsse::$db->tagSubscriptionsSet("john.doe@example.com", "Interesting", [1,3], Database::ASSOC_REMOVE, true); $state = $this->primeExpectations($this->data, $this->checkMembers); @@ -412,24 +412,24 @@ trait SeriesTag { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagSubscriptionsSet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagSubscriptionsSet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testApplyATagToNoSubscriptionsByName(): void { Arsse::$db->tagSubscriptionsSet("john.doe@example.com", "Interesting", [], Database::ASSOC_ADD, true); $state = $this->primeExpectations($this->data, $this->checkMembers); $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagSubscriptionsSet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagSubscriptionsSet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testClearATagFromNoSubscriptionsByName(): void { Arsse::$db->tagSubscriptionsSet("john.doe@example.com", "Interesting", [], Database::ASSOC_REMOVE, true); $state = $this->primeExpectations($this->data, $this->checkMembers); $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagSubscriptionsSet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagSubscriptionsSet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testReplaceSubscriptionsOfATag(): void { Arsse::$db->tagSubscriptionsSet("john.doe@example.com", 1, [3,4], Database::ASSOC_REPLACE); $state = $this->primeExpectations($this->data, $this->checkMembers); @@ -440,8 +440,8 @@ trait SeriesTag { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagSubscriptionsSet")] - #[CoversMethod(Database::class, "tagValidateId")] + //#[CoversMethod(Database::class, "tagSubscriptionsSet")] + //#[CoversMethod(Database::class, "tagValidateId")] public function testPurgeSubscriptionsOfATag(): void { Arsse::$db->tagSubscriptionsSet("john.doe@example.com", 1, [], Database::ASSOC_REPLACE); $state = $this->primeExpectations($this->data, $this->checkMembers); @@ -450,7 +450,7 @@ trait SeriesTag { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tagSummarize")] + //#[CoversMethod(Database::class, "tagSummarize")] public function testSummarizeTags(): void { $exp = [ ['id' => 1, 'name' => "Interesting", 'subscription' => 1], diff --git a/tests/cases/Database/SeriesToken.php b/tests/cases/Database/SeriesToken.php index f8913fc4..2e1cf307 100644 --- a/tests/cases/Database/SeriesToken.php +++ b/tests/cases/Database/SeriesToken.php @@ -56,7 +56,7 @@ trait SeriesToken { unset($this->data); } - #[CoversMethod(Database::class, "tokenLookup")] + //#[CoversMethod(Database::class, "tokenLookup")] public function testLookUpAValidToken(): void { $exp1 = [ 'id' => "80fa94c1a11f11e78667001e673b2560", @@ -78,25 +78,25 @@ trait SeriesToken { $this->assertArraySubset($exp3, Arsse::$db->tokenLookup("class.class", "ab3b3eb8a13311e78667001e673b2560")); } - #[CoversMethod(Database::class, "tokenLookup")] + //#[CoversMethod(Database::class, "tokenLookup")] public function testLookUpAMissingToken(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->tokenLookup("class", "thisTokenDoesNotExist"); } - #[CoversMethod(Database::class, "tokenLookup")] + //#[CoversMethod(Database::class, "tokenLookup")] public function testLookUpAnExpiredToken(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->tokenLookup("fever.login", "27c6de8da13311e78667001e673b2560"); } - #[CoversMethod(Database::class, "tokenLookup")] + //#[CoversMethod(Database::class, "tokenLookup")] public function testLookUpATokenOfTheWrongClass(): void { $this->assertException("subjectMissing", "Db", "ExceptionInput"); Arsse::$db->tokenLookup("some.class", "80fa94c1a11f11e78667001e673b2560"); } - #[CoversMethod(Database::class, "tokenCreate")] + //#[CoversMethod(Database::class, "tokenCreate")] public function testCreateAToken(): void { $user = "jane.doe@example.com"; $state = $this->primeExpectations($this->data, ['arsse_tokens' => ["id", "class", "expires", "user"]]); @@ -111,13 +111,13 @@ trait SeriesToken { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "tokenCreate")] + //#[CoversMethod(Database::class, "tokenCreate")] public function testCreateATokenForAMissingUser(): void { $this->assertException("doesNotExist", "User", "ExceptionConflict"); Arsse::$db->tokenCreate("fever.login", "jane.doe@example.biz"); } - #[CoversMethod(Database::class, "tokenRevoke")] + //#[CoversMethod(Database::class, "tokenRevoke")] public function testRevokeAToken(): void { $user = "jane.doe@example.com"; $id = "80fa94c1a11f11e78667001e673b2560"; @@ -129,7 +129,7 @@ trait SeriesToken { $this->assertFalse(Arsse::$db->tokenRevoke($user, "fever.login", $id)); } - #[CoversMethod(Database::class, "tokenRevoke")] + //#[CoversMethod(Database::class, "tokenRevoke")] public function testRevokeAllTokens(): void { $user = "jane.doe@example.com"; $state = $this->primeExpectations($this->data, ['arsse_tokens' => ["id", "expires", "user"]]); @@ -144,7 +144,7 @@ trait SeriesToken { $this->assertFalse(Arsse::$db->tokenRevoke($user, "unknown.class")); } - #[CoversMethod(Database::class, "tokenList")] + //#[CoversMethod(Database::class, "tokenList")] public function testListTokens(): void { $user = "jane.doe@example.com"; $exp = [ diff --git a/tests/cases/Database/SeriesUser.php b/tests/cases/Database/SeriesUser.php index 675364e9..e558e210 100644 --- a/tests/cases/Database/SeriesUser.php +++ b/tests/cases/Database/SeriesUser.php @@ -52,27 +52,27 @@ trait SeriesUser { unset($this->data); } - #[CoversMethod(Database::class, "userExists")] + //#[CoversMethod(Database::class, "userExists")] public function testCheckThatAUserExists(): void { $this->assertTrue(Arsse::$db->userExists("jane.doe@example.com")); $this->assertFalse(Arsse::$db->userExists("jane.doe@example.org")); $this->compareExpectations(static::$drv, $this->data); } - #[CoversMethod(Database::class, "userPasswordGet")] + //#[CoversMethod(Database::class, "userPasswordGet")] public function testGetAPassword(): void { $hash = Arsse::$db->userPasswordGet("admin@example.net"); $this->assertSame('$2y$10$PbcG2ZR3Z8TuPzM7aHTF8.v61dtCjzjK78gdZJcp4UePE8T9jEgBW', $hash); $this->assertTrue(password_verify("secret", $hash)); } - #[CoversMethod(Database::class, "userPasswordGet")] + //#[CoversMethod(Database::class, "userPasswordGet")] public function testGetThePasswordOfAMissingUser(): void { $this->assertException("doesNotExist", "User", "ExceptionConflict"); Arsse::$db->userPasswordGet("john.doe@example.org"); } - #[CoversMethod(Database::class, "userAdd")] + //#[CoversMethod(Database::class, "userAdd")] public function testAddANewUser(): void { $this->assertTrue(Arsse::$db->userAdd("john.doe@example.org", "")); $state = $this->primeExpectations($this->data, ['arsse_users' => ['id']]); @@ -80,13 +80,13 @@ trait SeriesUser { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "userAdd")] + //#[CoversMethod(Database::class, "userAdd")] public function testAddAnExistingUser(): void { $this->assertException("alreadyExists", "User", "ExceptionConflict"); Arsse::$db->userAdd("john.doe@example.com", ""); } - #[CoversMethod(Database::class, "userRemove")] + //#[CoversMethod(Database::class, "userRemove")] public function testRemoveAUser(): void { $this->assertTrue(Arsse::$db->userRemove("admin@example.net")); $state = $this->primeExpectations($this->data, ['arsse_users' => ['id']]); @@ -94,19 +94,19 @@ trait SeriesUser { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "userRemove")] + //#[CoversMethod(Database::class, "userRemove")] public function testRemoveAMissingUser(): void { $this->assertException("doesNotExist", "User", "ExceptionConflict"); Arsse::$db->userRemove("john.doe@example.org"); } - #[CoversMethod(Database::class, "userList")] + //#[CoversMethod(Database::class, "userList")] public function testListAllUsers(): void { $users = ["admin@example.net", "jane.doe@example.com", "john.doe@example.com"]; $this->assertSame($users, Arsse::$db->userList()); } - #[CoversMethod(Database::class, "userPasswordSet")] + //#[CoversMethod(Database::class, "userPasswordSet")] public function testSetAPassword(): void { $user = "john.doe@example.com"; $pass = "secret"; @@ -117,7 +117,7 @@ trait SeriesUser { $this->assertTrue(password_verify($pass, $hash), "Failed verifying password of $user '$pass' against hash '$hash'."); } - #[CoversMethod(Database::class, "userPasswordSet")] + //#[CoversMethod(Database::class, "userPasswordSet")] public function testUnsetAPassword(): void { $user = "john.doe@example.com"; $this->assertEquals("", Arsse::$db->userPasswordGet($user)); @@ -125,14 +125,14 @@ trait SeriesUser { $this->assertNull(Arsse::$db->userPasswordGet($user)); } - #[CoversMethod(Database::class, "userPasswordSet")] + //#[CoversMethod(Database::class, "userPasswordSet")] public function testSetThePasswordOfAMissingUser(): void { $this->assertException("doesNotExist", "User", "ExceptionConflict"); Arsse::$db->userPasswordSet("john.doe@example.org", "secret"); } #[DataProvider("provideMetaData")] - #[CoversMethod(Database::class, "userPropertiesGet")] + //#[CoversMethod(Database::class, "userPropertiesGet")] public function testGetMetadata(string $user, bool $includeLarge, array $exp): void { $this->assertSame($exp, Arsse::$db->userPropertiesGet($user, $includeLarge)); } @@ -148,13 +148,13 @@ trait SeriesUser { ]; } - #[CoversMethod(Database::class, "userPropertiesGet")] + //#[CoversMethod(Database::class, "userPropertiesGet")] public function testGetTheMetadataOfAMissingUser(): void { $this->assertException("doesNotExist", "User", "ExceptionConflict"); Arsse::$db->userPropertiesGet("john.doe@example.org"); } - #[CoversMethod(Database::class, "userPropertiesSet")] + //#[CoversMethod(Database::class, "userPropertiesSet")] public function testSetMetadata(): void { $in = [ 'admin' => true, @@ -171,7 +171,7 @@ trait SeriesUser { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "userPropertiesSet")] + //#[CoversMethod(Database::class, "userPropertiesSet")] public function testSetNoMetadata(): void { $in = [ 'num' => 2112, @@ -182,26 +182,26 @@ trait SeriesUser { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "userPropertiesSet")] + //#[CoversMethod(Database::class, "userPropertiesSet")] public function testSetTheMetadataOfAMissingUser(): void { $this->assertException("doesNotExist", "User", "ExceptionConflict"); Arsse::$db->userPropertiesSet("john.doe@example.org", ['admin' => true]); } - #[CoversMethod(Database::class, "userLookup")] + //#[CoversMethod(Database::class, "userLookup")] public function testLookUpAUserByNumber(): void { $this->assertSame("admin@example.net", Arsse::$db->userLookup(1)); $this->assertSame("jane.doe@example.com", Arsse::$db->userLookup(2)); $this->assertSame("john.doe@example.com", Arsse::$db->userLookup(3)); } - #[CoversMethod(Database::class, "userLookup")] + //#[CoversMethod(Database::class, "userLookup")] public function testLookUpAMissingUserByNumber(): void { $this->assertException("doesNotExist", "User", "ExceptionConflict"); Arsse::$db->userLookup(2112); } - #[CoversMethod(Database::class, "userRename")] + //#[CoversMethod(Database::class, "userRename")] public function testRenameAUser(): void { $this->assertTrue(Arsse::$db->userRename("john.doe@example.com", "juan.doe@example.com")); $state = $this->primeExpectations($this->data, [ @@ -213,24 +213,24 @@ trait SeriesUser { $this->compareExpectations(static::$drv, $state); } - #[CoversMethod(Database::class, "userRename")] + //#[CoversMethod(Database::class, "userRename")] public function testRenameAUserToTheSameName(): void { $this->assertFalse(Arsse::$db->userRename("john.doe@example.com", "john.doe@example.com")); } - #[CoversMethod(Database::class, "userRename")] + //#[CoversMethod(Database::class, "userRename")] public function testRenameAMissingUser(): void { $this->assertException("doesNotExist", "User", "ExceptionConflict"); Arsse::$db->userRename("juan.doe@example.com", "john.doe@example.com"); } - #[CoversMethod(Database::class, "userRename")] + //#[CoversMethod(Database::class, "userRename")] public function testRenameAUserToADuplicateName(): void { $this->assertException("alreadyExists", "User", "ExceptionConflict"); Arsse::$db->userRename("john.doe@example.com", "jane.doe@example.com"); } - #[CoversMethod(Database::class, "userAdd")] + //#[CoversMethod(Database::class, "userAdd")] public function testAddFirstUser(): void { // first truncate the users table static::$drv->exec("DELETE FROM arsse_users"); diff --git a/tests/cases/Database/TestDatabase.php b/tests/cases/Database/TestDatabase.php index 05c0abc7..973143f3 100644 --- a/tests/cases/Database/TestDatabase.php +++ b/tests/cases/Database/TestDatabase.php @@ -10,11 +10,11 @@ namespace JKingWeb\Arsse\TestCase\Database; use JKingWeb\Arsse\Database; use JKingWeb\Arsse\Db\Transaction; -use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\CoversMethod; -#[CoversNothing] +#[CoversClass(Database::class)] class TestDatabase extends \JKingWeb\Arsse\Test\AbstractTest { protected $db = null; @@ -39,7 +39,7 @@ class TestDatabase extends \JKingWeb\Arsse\Test\AbstractTest { return $m->invoke($this->db, ...$arg); } - #[CoversMethod(Database::class, "generateIn")] + //#[CoversMethod(Database::class, "generateIn")] #[DataProvider('provideInClauses')] public function testGenerateInClause(string $clause, array $values, array $inV, string $inT): void { $types = array_fill(0, sizeof($values), $inT); @@ -74,7 +74,7 @@ class TestDatabase extends \JKingWeb\Arsse\Test\AbstractTest { ]; } - #[CoversMethod(Database::class, "generateSearch")] + //#[CoversMethod(Database::class, "generateSearch")] #[DataProvider('provideSearchClauses')] public function testGenerateSearchClause(string $clause, array $values, array $inV, array $inC, bool $inAny): void { // this is not an exhaustive test; integration tests already cover the ins and outs of the functionality @@ -99,7 +99,7 @@ class TestDatabase extends \JKingWeb\Arsse\Test\AbstractTest { ]; } - #[CoversMethod(Database::class, "generateSet")] + //#[CoversMethod(Database::class, "generateSet")] public function testGenerateSetClause(): void { $in = [ 'ook' => true, @@ -121,12 +121,12 @@ class TestDatabase extends \JKingWeb\Arsse\Test\AbstractTest { $this->assertSame($exp, $this->invoke("generateSet", $in, $valid)); } - #[CoversMethod(Database::class, "begin")] + //#[CoversMethod(Database::class, "begin")] public function testBeginATransaction(): void { $this->assertInstanceOf(Transaction::class, $this->invoke("begin")); } - #[CoversMethod(Database::class, "caller")] + //#[CoversMethod(Database::class, "caller")] public function testReportCallingMethod(): void { $this->assertSame("caller", $this->invoke("caller")); } diff --git a/tests/cases/Db/MySQL/TestCreation.php b/tests/cases/Db/MySQL/TestCreation.php index 2118fa17..99fdb401 100644 --- a/tests/cases/Db/MySQL/TestCreation.php +++ b/tests/cases/Db/MySQL/TestCreation.php @@ -8,11 +8,12 @@ declare(strict_types=1); namespace JKingWeb\Arsse\TestCase\Db\MySQL; use JKingWeb\Arsse\Db\MySQL\Driver as Driver; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Group; -/** - * @group slow - * @covers \JKingWeb\Arsse\Db\MySQL\Driver