summaryrefslogtreecommitdiff
path: root/tests/units/SwimlaneTest.php
diff options
context:
space:
mode:
authorMichael Lüpkes <michael@luepkes.net>2015-02-03 11:16:10 +0100
committerMichael Lüpkes <michael@luepkes.net>2015-02-03 11:16:10 +0100
commite5ea36125536b5ac8f8a7e31c2602e9bd1b52075 (patch)
tree1879bcf0ca1fb3f7ea7375c548fdc00ab75e715a /tests/units/SwimlaneTest.php
parent24300f828a684eedf71d63374effb2be95c13b1a (diff)
Implemented Changes to Project Duplication to include Swimlanes and Tasks.
ProjectDuplication::duplicate accepts additional param of type array now. Array includes which optional parts to duplicate. Optional parts are: 'swimlane', 'category', 'task', 'action'.
Diffstat (limited to 'tests/units/SwimlaneTest.php')
-rw-r--r--tests/units/SwimlaneTest.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/units/SwimlaneTest.php b/tests/units/SwimlaneTest.php
index bda0f590..0694f08a 100644
--- a/tests/units/SwimlaneTest.php
+++ b/tests/units/SwimlaneTest.php
@@ -375,4 +375,34 @@ class SwimlaneTest extends Base
$this->assertEquals(0, $swimlane['is_active']);
$this->assertEquals(0, $swimlane['position']);
}
+
+ public function testDuplicateSwimlane()
+ {
+ $p = new Project($this->container);
+ $s = new Swimlane($this->container);
+
+ $this->assertEquals(1, $p->create(array('name' => 'P1')));
+ $this->assertEquals(2, $p->create(array('name' => 'P2')));
+ $this->assertEquals(1, $s->create(1, 'S1'));
+ $this->assertEquals(2, $s->create(1, 'S2'));
+ $this->assertEquals(3, $s->create(1, 'S3'));
+
+ $default_swimlane1 = $s->getDefault(1);
+ $default_swimlane1['default_swimlane'] = 'New Default';
+
+ $this->assertTrue($s->updateDefault($default_swimlane1));
+
+ $this->assertTrue($s->duplicate(1, 2));
+
+ $swimlanes = $s->getAll(2);
+
+ $this->assertCount(3, $swimlanes);
+ $this->assertEquals(4, $swimlanes[0]['id']);
+ $this->assertEquals('S1', $swimlanes[0]['name']);
+ $this->assertEquals(5, $swimlanes[1]['id']);
+ $this->assertEquals('S2', $swimlanes[1]['name']);
+ $this->assertEquals(6, $swimlanes[2]['id']);
+ $this->assertEquals('S3', $swimlanes[2]['name']);
+ $this->assertEquals('New Default', $s->getDefault(2)['default_swimlane']);
+ }
}