summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-07-31 14:45:06 -0400
committerFrederic Guillot <fred@kanboard.net>2016-07-31 14:45:06 -0400
commitdc5accae30d225fd0d114055036bfee9b897110c (patch)
tree5245bf7b840bb79685244f03ba8b5e2d031c49b3 /tests/integration
parentf5abf6c94e1cdf3120fce50eed55076c9caa9e6f (diff)
parented4a71370625158760b420f1780ecae142cd502d (diff)
Merge pull-request #2535
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/TaskProcedureTest.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/integration/TaskProcedureTest.php b/tests/integration/TaskProcedureTest.php
index f456ae52..f932355c 100644
--- a/tests/integration/TaskProcedureTest.php
+++ b/tests/integration/TaskProcedureTest.php
@@ -5,6 +5,7 @@ require_once __DIR__.'/BaseProcedureTest.php';
class TaskProcedureTest extends BaseProcedureTest
{
protected $projectName = 'My project to test tasks';
+ protected $metaKey = 'MyTestMetaKey';
public function testAll()
{
@@ -15,8 +16,45 @@ class TaskProcedureTest extends BaseProcedureTest
$this->assertGetTaskByReference();
$this->assertGetAllTasks();
$this->assertOpenCloseTask();
+ $this->assertSaveTaskMetadata();
+ $this->assertGetTaskMetadata();
+ $this->assertGetTaskMetadataByName();
+ $this->assertRemoveTaskMetadata():
}
+ public function assertSaveTaskMetadata()
+ {
+ $createMetaKey = $this->app->saveTaskMetadata($this->taskId,array($this->metaKey => 'metaValue1'));
+ $this->assertTrue($createMetaKey);
+ }
+
+ public function assertGetTaskMetadata()
+ {
+ $createMetaKey = $this->app->saveTaskMetadata($this->taskId,array($this->metaKey => 'metaValue1'));
+ $this->assertTrue($createMetaKey,'Did not create metakey with success');
+ $metaData = $this->app->getTaskMetadata(($this->taskId);
+ $this->assertArrayHasKey($this->metaKey, $metaData);
+ $this->assertEquals('metaValue1', $metaData[$this->metaKey]);
+ }
+
+ public function assertGetTaskMetadataByName()
+ {
+ $createMetaKey = $this->app->saveTaskMetadata($this->taskId,array($this->metaKey => 'metaValue1'));
+ $this->assertTrue($createMetaKey,'Did not create metakey with success');
+ $metaValue = $this->app->getTaskMetadataByName($this->taskId,$this->metaKey);
+ $this->assertEquals('metaValue1', $metaValue, 'Did not return correct metadata value');
+ }
+
+ public function assertRemoveTaskMetadata()
+ {
+ $createMetaKey = $this->app->saveTaskMetadata($this->taskId,array($this->metaKey => 'metaValue1'));
+ $this->assertTrue($createMetaKey,'Did not create metakey with success');
+ $metaValue = $this->app->removeTaskMetadata($this->taskId,$this->metaKey);
+ $this->assertTrue($metaValue,'Did not remove metakey with success');
+ $metaValue = $this->app->getTaskMetadataByName($this->taskId,$this->metaKey);
+ $this->assertEquals('',$metaValue,'Did not return an empty string due to metadata being deleted');
+ }
+
public function assertUpdateTask()
{
$this->assertTrue($this->app->updateTask(array('id' => $this->taskId, 'color_id' => 'red')));