diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-12-30 16:59:21 +0100 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-12-30 16:59:35 +0100 |
commit | 65f26699a63bd05859208092abb5d9ec1429a53f (patch) | |
tree | 02b37a94090d0b3fb8c71bf7cec229dbece5867a /tests/units/Model | |
parent | 9039e27b13c7836dd22cef0a069c8f168e8f2287 (diff) |
Add unit test to remove metadata
Diffstat (limited to 'tests/units/Model')
-rw-r--r-- | tests/units/Model/ProjectMetadataTest.php | 5 | ||||
-rw-r--r-- | tests/units/Model/TaskMetadataTest.php | 5 | ||||
-rw-r--r-- | tests/units/Model/UserMetadataTest.php | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/units/Model/ProjectMetadataTest.php b/tests/units/Model/ProjectMetadataTest.php index 43d66b7b..5814987d 100644 --- a/tests/units/Model/ProjectMetadataTest.php +++ b/tests/units/Model/ProjectMetadataTest.php @@ -30,6 +30,11 @@ class ProjectMetadataTest extends Base $this->assertEquals(array('key1' => 'value2'), $pm->getAll(1)); $this->assertEquals(array('key1' => 'value1', 'key2' => 'value2'), $pm->getAll(2)); + + $this->assertTrue($pm->remove(2, 'key1')); + $this->assertFalse($pm->remove(2, 'key1')); + + $this->assertEquals(array('key2' => 'value2'), $pm->getAll(2)); } public function testAutomaticRemove() diff --git a/tests/units/Model/TaskMetadataTest.php b/tests/units/Model/TaskMetadataTest.php index 9ce7d6be..2683c297 100644 --- a/tests/units/Model/TaskMetadataTest.php +++ b/tests/units/Model/TaskMetadataTest.php @@ -33,5 +33,10 @@ class TaskMetadataTest extends Base $this->assertEquals(array('key1' => 'value2'), $tm->getAll(1)); $this->assertEquals(array('key1' => 'value1', 'key2' => 'value2'), $tm->getAll(2)); + + $this->assertTrue($tm->remove(2, 'key1')); + $this->assertFalse($tm->remove(2, 'key1')); + + $this->assertEquals(array('key2' => 'value2'), $tm->getAll(2)); } } diff --git a/tests/units/Model/UserMetadataTest.php b/tests/units/Model/UserMetadataTest.php index cc1fff12..457f1fb2 100644 --- a/tests/units/Model/UserMetadataTest.php +++ b/tests/units/Model/UserMetadataTest.php @@ -29,5 +29,10 @@ class UserMetadataTest extends Base $this->assertEquals(array('key1' => 'value2'), $m->getAll(1)); $this->assertEquals(array('key1' => 'value1', 'key2' => 'value2'), $m->getAll(2)); + + $this->assertTrue($m->remove(2, 'key1')); + $this->assertFalse($m->remove(2, 'key1')); + + $this->assertEquals(array('key2' => 'value2'), $m->getAll(2)); } } |