summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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());
+ }
}