summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Huynh <linkatox@gmail.com>2021-03-16 23:54:14 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-03-17 08:58:42 +0100
commit3ca55613b60ad947b2365a113ae97c6b22667783 (patch)
tree03ebc6cebc7ba90be562e51f9c69cbd67f5a4e63
parentef366c3bc764a208589ce403d60d1fe798c0e487 (diff)
✅ Add tests of categories
Signed-off-by: Jimmy Huynh <linkatox@gmail.com>
-rw-r--r--tests/Unit/Db/ItemTest.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/Unit/Db/ItemTest.php b/tests/Unit/Db/ItemTest.php
index 1fd968efc..80e3d630f 100644
--- a/tests/Unit/Db/ItemTest.php
+++ b/tests/Unit/Db/ItemTest.php
@@ -369,4 +369,19 @@ class ItemTest extends TestCase
);
}
+ public function testSetCategories()
+ {
+ $item = new Item();
+ $item->setCategories(['podcast', 'blog']);
+ $this->assertEquals(['podcast', 'blog'], $item->getCategories());
+ $this->assertArrayHasKey('categoriesJson', $item->getUpdatedFields());
+ }
+
+ public function testSetCategoriesJson()
+ {
+ $item = new Item();
+ $item->setCategoriesJson(json_encode(['podcast', 'blog']));
+ $this->assertEquals(json_encode(['podcast', 'blog']), $item->getCategoriesJson());
+ $this->assertArrayHasKey('categoriesJson', $item->getUpdatedFields());
+ }
}