summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-09-05 11:23:51 -0400
committerFrederic Guillot <fred@kanboard.net>2015-09-05 11:23:51 -0400
commitbac18d80f8ff8fce9d167671273e80a492f4c3c5 (patch)
treecdb950786eb3d8a92c7307695ce6680041b5a175 /tests
parent69c5c83d34229c92a6b9c38c225a81058ab94047 (diff)
parent42a3a56a91bbc6f1f8c913c8a990d9ea549d481b (diff)
Merge pull-request #1178
Diffstat (limited to 'tests')
-rw-r--r--tests/units/BoardTest.php2
-rw-r--r--tests/units/ProjectDuplicationTest.php18
-rw-r--r--tests/units/SwimlaneTest.php50
-rw-r--r--tests/units/TaskDuplicationTest.php24
-rw-r--r--tests/units/TaskExportTest.php4
-rw-r--r--tests/units/TaskFilterTest.php4
-rw-r--r--tests/units/TaskMovedDateSubscriberTest.php4
-rw-r--r--tests/units/TaskPositionTest.php4
8 files changed, 55 insertions, 55 deletions
diff --git a/tests/units/BoardTest.php b/tests/units/BoardTest.php
index ebd4f655..3542f783 100644
--- a/tests/units/BoardTest.php
+++ b/tests/units/BoardTest.php
@@ -70,7 +70,7 @@ class BoardTest extends Base
$s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'Project #1')));
- $this->assertEquals(1, $s->create(1, 'test 1'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'test 1')));
$this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1)));
$this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'column_id' => 3)));
$this->assertEquals(3, $tc->create(array('title' => 'Task #3', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));
diff --git a/tests/units/ProjectDuplicationTest.php b/tests/units/ProjectDuplicationTest.php
index 311ecc4a..0a0bc3eb 100644
--- a/tests/units/ProjectDuplicationTest.php
+++ b/tests/units/ProjectDuplicationTest.php
@@ -215,9 +215,9 @@ class ProjectDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'P1')));
// create initial swimlanes
- $this->assertEquals(1, $s->create(1, 'S1'));
- $this->assertEquals(2, $s->create(1, 'S2'));
- $this->assertEquals(3, $s->create(1, 'S3'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
+ $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'S3')));
$default_swimlane1 = $s->getDefault(1);
$default_swimlane1['default_swimlane'] = 'New Default';
@@ -277,9 +277,9 @@ class ProjectDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'P1')));
// create initial swimlanes
- $this->assertEquals(1, $s->create(1, 'S1'));
- $this->assertEquals(2, $s->create(1, 'S2'));
- $this->assertEquals(3, $s->create(1, 'S3'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
+ $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'S3')));
$default_swimlane1 = $s->getDefault(1);
$default_swimlane1['default_swimlane'] = 'New Default';
@@ -323,9 +323,9 @@ class ProjectDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'P1')));
// create initial swimlanes
- $this->assertEquals(1, $s->create(1, 'S1'));
- $this->assertEquals(2, $s->create(1, 'S2'));
- $this->assertEquals(3, $s->create(1, 'S3'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
+ $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'S3')));
$default_swimlane1 = $s->getDefault(1);
$default_swimlane1['default_swimlane'] = 'New Default';
diff --git a/tests/units/SwimlaneTest.php b/tests/units/SwimlaneTest.php
index 37226613..af187f41 100644
--- a/tests/units/SwimlaneTest.php
+++ b/tests/units/SwimlaneTest.php
@@ -16,7 +16,7 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
- $this->assertEquals(1, $s->create(1, 'Swimlane #1'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$swimlanes = $s->getSwimlanes(1);
$this->assertNotEmpty($swimlanes);
@@ -37,8 +37,8 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
- $this->assertEquals(1, $s->create(1, 'Swimlane #1'));
- $this->assertEquals(2, $s->create(1, 'Swimlane #2'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Swimlane #2')));
$swimlanes = $s->getList(1);
$expected = array('Default swimlane', 'Swimlane #1', 'Swimlane #2');
@@ -46,26 +46,26 @@ class SwimlaneTest extends Base
$this->assertEquals($expected, $swimlanes);
}
- public function testRename()
+ public function testUpdate()
{
$p = new Project($this->container);
$s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
- $this->assertEquals(1, $s->create(1, 'Swimlane #1'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane);
$this->assertEquals('Swimlane #1', $swimlane['name']);
- $this->assertTrue($s->rename(1, 'foobar'));
+ $this->assertTrue($s->update(array('id' => 1, 'name' => 'foobar')));
$swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane);
$this->assertEquals('foobar', $swimlane['name']);
}
- public function testRenameDefaultSwimlane()
+ public function testUpdateDefaultSwimlane()
{
$p = new Project($this->container);
$s = new Swimlane($this->container);
@@ -92,7 +92,7 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
- $this->assertEquals(1, $s->create(1, 'Swimlane #1'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane);
@@ -110,7 +110,7 @@ class SwimlaneTest extends Base
$this->assertEquals(1, $s->getLastPosition(1));
// Create a new swimlane
- $this->assertEquals(2, $s->create(1, 'Swimlane #2'));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Swimlane #2')));
$swimlane = $s->getById(2);
$this->assertNotEmpty($swimlane);
@@ -134,7 +134,7 @@ class SwimlaneTest extends Base
$tf = new TaskFinder($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
- $this->assertEquals(1, $s->create(1, 'Swimlane #1'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'swimlane_id' => 1)));
$task = $tf->getbyId(1);
@@ -156,9 +156,9 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
- $this->assertEquals(1, $s->create(1, 'Swimlane #1'));
- $this->assertEquals(2, $s->create(1, 'Swimlane #2'));
- $this->assertEquals(3, $s->create(1, 'Swimlane #3'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Swimlane #2')));
+ $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'Swimlane #3')));
$swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane);
@@ -216,10 +216,10 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
- $this->assertEquals(1, $s->create(1, 'Swimlane #1'));
- $this->assertEquals(2, $s->create(1, 'Swimlane #2'));
- $this->assertEquals(3, $s->create(1, 'Swimlane #3'));
-
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Swimlane #2')));
+ $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'Swimlane #3')));
+
$swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane);
$this->assertEquals(1, $swimlane['is_active']);
@@ -299,10 +299,10 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
- $this->assertEquals(1, $s->create(1, 'Swimlane #1'));
- $this->assertEquals(2, $s->create(1, 'Swimlane #2'));
- $this->assertEquals(3, $s->create(1, 'Swimlane #3'));
-
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Swimlane #2')));
+ $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'Swimlane #3')));
+
$swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane);
$this->assertEquals(1, $swimlane['is_active']);
@@ -383,10 +383,10 @@ class SwimlaneTest extends Base
$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'));
-
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
+ $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'S3')));
+
$default_swimlane1 = $s->getDefault(1);
$default_swimlane1['default_swimlane'] = 'New Default';
diff --git a/tests/units/TaskDuplicationTest.php b/tests/units/TaskDuplicationTest.php
index e87fe9cc..25b9e9fe 100644
--- a/tests/units/TaskDuplicationTest.php
+++ b/tests/units/TaskDuplicationTest.php
@@ -225,8 +225,8 @@ class TaskDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'test1')));
$this->assertEquals(2, $p->create(array('name' => 'test2')));
- $this->assertNotFalse($s->create(1, 'Swimlane #1'));
- $this->assertNotFalse($s->create(2, 'Swimlane #1'));
+ $this->assertNotFalse($s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
+ $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #1')));
// We create a task
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));
@@ -258,9 +258,9 @@ class TaskDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'test1')));
$this->assertEquals(2, $p->create(array('name' => 'test2')));
- $this->assertNotFalse($s->create(1, 'Swimlane #1'));
- $this->assertNotFalse($s->create(2, 'Swimlane #2'));
-
+ $this->assertNotFalse($s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
+ $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #2')));
+
// We create a task
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));
@@ -291,9 +291,9 @@ class TaskDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'test1')));
$this->assertEquals(2, $p->create(array('name' => 'test2')));
- $this->assertNotFalse($s->create(1, 'Swimlane #1'));
- $this->assertNotFalse($s->create(2, 'Swimlane #1'));
- $this->assertNotFalse($s->create(2, 'Swimlane #2'));
+ $this->assertNotFalse($s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
+ $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #1')));
+ $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #2')));
// We create a task
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));
@@ -574,8 +574,8 @@ class TaskDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'test1')));
$this->assertEquals(2, $p->create(array('name' => 'test2')));
- $this->assertNotFalse($s->create(1, 'Swimlane #1'));
- $this->assertNotFalse($s->create(2, 'Swimlane #1'));
+ $this->assertNotFalse($s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
+ $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #1')));
// We create a task
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));
@@ -607,8 +607,8 @@ class TaskDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'test1')));
$this->assertEquals(2, $p->create(array('name' => 'test2')));
- $this->assertNotFalse($s->create(1, 'Swimlane #1'));
- $this->assertNotFalse($s->create(2, 'Swimlane #2'));
+ $this->assertNotFalse($s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
+ $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #2')));
// We create a task
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));
diff --git a/tests/units/TaskExportTest.php b/tests/units/TaskExportTest.php
index 3892f2bd..964418d3 100644
--- a/tests/units/TaskExportTest.php
+++ b/tests/units/TaskExportTest.php
@@ -22,8 +22,8 @@ class TaskExportTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'Export Project')));
- $this->assertEquals(1, $s->create(1, 'S1'));
- $this->assertEquals(2, $s->create(1, 'S2'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
$this->assertNotFalse($c->create(array('name' => 'Category #1', 'project_id' => 1)));
$this->assertNotFalse($c->create(array('name' => 'Category #2', 'project_id' => 1)));
diff --git a/tests/units/TaskFilterTest.php b/tests/units/TaskFilterTest.php
index 1ae1e5b8..07a34691 100644
--- a/tests/units/TaskFilterTest.php
+++ b/tests/units/TaskFilterTest.php
@@ -335,8 +335,8 @@ class TaskFilterTest extends Base
$s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'My project A')));
- $this->assertEquals(1, $s->create(1, 'Version 1.1'));
- $this->assertEquals(2, $s->create(1, 'Version 1.2'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Version 1.1')));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Version 1.2')));
$this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'task1', 'swimlane_id' => 1)));
$this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'task2', 'swimlane_id' => 2)));
$this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'task3', 'swimlane_id' => 0)));
diff --git a/tests/units/TaskMovedDateSubscriberTest.php b/tests/units/TaskMovedDateSubscriberTest.php
index e0364918..3b7e494b 100644
--- a/tests/units/TaskMovedDateSubscriberTest.php
+++ b/tests/units/TaskMovedDateSubscriberTest.php
@@ -54,8 +54,8 @@ class TaskMovedDateSubscriberTest extends Base
$now = time();
$this->assertEquals(1, $p->create(array('name' => 'Project #1')));
- $this->assertEquals(1, $s->create(1, 'S1'));
- $this->assertEquals(2, $s->create(1, 'S2'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
+ $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
$this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1)));
$task = $tf->getById(1);
diff --git a/tests/units/TaskPositionTest.php b/tests/units/TaskPositionTest.php
index 83436683..ec0f7927 100644
--- a/tests/units/TaskPositionTest.php
+++ b/tests/units/TaskPositionTest.php
@@ -425,7 +425,7 @@ class TaskPositionTest extends Base
$s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'Project #1')));
- $this->assertEquals(1, $s->create(1, 'test 1'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'test 1')));
$this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1)));
$this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'column_id' => 1)));
$this->assertEquals(3, $tc->create(array('title' => 'Task #3', 'project_id' => 1, 'column_id' => 1)));
@@ -532,7 +532,7 @@ class TaskPositionTest extends Base
$s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'Project #1')));
- $this->assertEquals(1, $s->create(1, 'test 1'));
+ $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'test 1')));
$this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1)));
$this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'column_id' => 2)));