diff options
author | Jimmy Huynh <linkatox@gmail.com> | 2021-03-16 23:54:14 +0100 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2021-03-17 08:58:42 +0100 |
commit | 3ca55613b60ad947b2365a113ae97c6b22667783 (patch) | |
tree | 03ebc6cebc7ba90be562e51f9c69cbd67f5a4e63 /tests/Unit/Db | |
parent | ef366c3bc764a208589ce403d60d1fe798c0e487 (diff) |
✅ Add tests of categories
Signed-off-by: Jimmy Huynh <linkatox@gmail.com>
Diffstat (limited to 'tests/Unit/Db')
-rw-r--r-- | tests/Unit/Db/ItemTest.php | 15 |
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()); + } } |