summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Api/Swimlane.php12
-rw-r--r--app/Controller/Swimlane.php20
-rw-r--r--app/Model/Swimlane.php28
-rw-r--r--app/Schema/Mysql.php7
-rw-r--r--app/Schema/Postgres.php7
-rw-r--r--app/Schema/Sqlite.php7
-rw-r--r--app/Template/board/table_swimlane.php8
-rw-r--r--app/Template/swimlane/edit.php21
-rw-r--r--app/Template/swimlane/index.php20
-rw-r--r--app/Template/swimlane/table.php2
-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
18 files changed, 158 insertions, 84 deletions
diff --git a/app/Api/Swimlane.php b/app/Api/Swimlane.php
index fb40841f..13838d77 100644
--- a/app/Api/Swimlane.php
+++ b/app/Api/Swimlane.php
@@ -40,14 +40,18 @@ class Swimlane extends \Core\Base
return $this->swimlane->getDefault($project_id);
}
- public function addSwimlane($project_id, $name)
+ public function addSwimlane($project_id, $name, $description = '')
{
- return $this->swimlane->create($project_id, $name);
+ return $this->swimlane->create(array('project_id' => $project_id, 'name' => $name, 'description' => $description));
}
- public function updateSwimlane($swimlane_id, $name)
+ public function updateSwimlane($swimlane_id, $name, $description = null)
{
- return $this->swimlane->rename($swimlane_id, $name);
+ $values = array('id' => $swimlane_id, 'name' => $name);
+ if (!is_null($description)) {
+ $values['description'] = $description;
+ }
+ return $this->swimlane->update($values);
}
public function removeSwimlane($project_id, $swimlane_id)
diff --git a/app/Controller/Swimlane.php b/app/Controller/Swimlane.php
index 054fa4ba..02fe8a6e 100644
--- a/app/Controller/Swimlane.php
+++ b/app/Controller/Swimlane.php
@@ -58,16 +58,14 @@ class Swimlane extends Base
*/
public function save()
{
- $project = $this->getProject();
-
$values = $this->request->getValues();
list($valid, $errors) = $this->swimlane->validateCreation($values);
if ($valid) {
- if ($this->swimlane->create($project['id'], $values['name'])) {
+ if ($this->swimlane->create($values)) {
$this->session->flash(t('Your swimlane have been created successfully.'));
- $this->response->redirect($this->helper->url->to('swimlane', 'index', array('project_id' => $project['id'])));
+ $this->response->redirect($this->helper->url->to('swimlane', 'index', array('project_id' => $values['project_id'])));
}
else {
$this->session->flashError(t('Unable to create your swimlane.'));
@@ -134,8 +132,7 @@ class Swimlane extends Base
list($valid, $errors) = $this->swimlane->validateModification($values);
if ($valid) {
-
- if ($this->swimlane->rename($values['id'], $values['name'])) {
+ if ($this->swimlane->update($values)) {
$this->session->flash(t('Swimlane updated successfully.'));
$this->response->redirect($this->helper->url->to('swimlane', 'index', array('project_id' => $project['id'])));
}
@@ -253,4 +250,15 @@ class Swimlane extends Base
$this->swimlane->moveDown($project['id'], $swimlane_id);
$this->response->redirect($this->helper->url->to('swimlane', 'index', array('project_id' => $project['id'])));
}
+
+ /**
+ * Display swimlane description
+ *
+ * @access public
+ */
+ public function description()
+ {
+ $swimlane = $this->swimlane->getById($this->request->getIntegerParam('swimlane_id'));
+ $this->response->html($this->template->render('board/tooltip_description', array('task' => $swimlane)));
+ }
}
diff --git a/app/Model/Swimlane.php b/app/Model/Swimlane.php
index 3b78a406..06e879a4 100644
--- a/app/Model/Swimlane.php
+++ b/app/Model/Swimlane.php
@@ -160,7 +160,7 @@ class Swimlane extends Base
public function getSwimlanes($project_id)
{
$swimlanes = $this->db->table(self::TABLE)
- ->columns('id', 'name')
+ ->columns('id', 'name', 'description')
->eq('project_id', $project_id)
->eq('is_active', self::ACTIVE)
->orderBy('position', 'asc')
@@ -216,32 +216,30 @@ class Swimlane extends Base
* Add a new swimlane
*
* @access public
- * @param integer $project_id
- * @param string $name
+ * @param array $values Form values
* @return integer|boolean
*/
- public function create($project_id, $name)
+ public function create($values)
{
- return $this->persist(self::TABLE, array(
- 'project_id' => $project_id,
- 'name' => $name,
- 'position' => $this->getLastPosition($project_id),
- ));
+ if (! $this->project->exists($values['project_id'])) {
+ return 0;
+ }
+ $values['position'] = $this->getLastPosition($values['project_id']);
+ return $this->persist(self::TABLE, $values);
}
/**
- * Rename a swimlane
+ * Update a swimlane
*
* @access public
- * @param integer $swimlane_id Swimlane id
- * @param string $name Swimlane name
+ * @param array $values Form values
* @return bool
*/
- public function rename($swimlane_id, $name)
+ public function update(array $values)
{
return $this->db->table(self::TABLE)
- ->eq('id', $swimlane_id)
- ->update(array('name' => $name));
+ ->eq('id', $values['id'])
+ ->update($values);
}
/**
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index b1ac0ab9..efdb159b 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -6,7 +6,12 @@ use PDO;
use Core\Security;
use Model\Link;
-const VERSION = 85;
+const VERSION = 86;
+
+function version_86($pdo)
+{
+ $pdo->exec("ALTER TABLE swimlanes ADD COLUMN description TEXT");
+}
function version_85($pdo)
{
diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php
index 9477b416..a5d28dcf 100644
--- a/app/Schema/Postgres.php
+++ b/app/Schema/Postgres.php
@@ -6,7 +6,12 @@ use PDO;
use Core\Security;
use Model\Link;
-const VERSION = 65;
+const VERSION = 66;
+
+function version_66($pdo)
+{
+ $pdo->exec("ALTER TABLE swimlanes ADD COLUMN description TEXT");
+}
function version_65($pdo)
{
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index b4e4b948..8efa016c 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.php
@@ -6,7 +6,12 @@ use Core\Security;
use PDO;
use Model\Link;
-const VERSION = 81;
+const VERSION = 82;
+
+function version_82($pdo)
+{
+ $pdo->exec("ALTER TABLE swimlanes ADD COLUMN description TEXT");
+}
function version_81($pdo)
{
diff --git a/app/Template/board/table_swimlane.php b/app/Template/board/table_swimlane.php
index be401633..ab4735b1 100644
--- a/app/Template/board/table_swimlane.php
+++ b/app/Template/board/table_swimlane.php
@@ -65,6 +65,14 @@
<div title="<?= t('Task count') ?>" class="board-column-header-task-count">
(<span><?= $swimlane['nb_tasks'] ?></span>)
+
+ <?php if (! empty($swimlane['description'])): ?>
+ <span title="<?= t('Description') ?>" class="tooltip"
+ data-href="<?= $this->url->href('swimlane', 'description', array('swimlane_id' => $swimlane['id'], 'project_id' => $swimlane['project_id'])) ?>">
+ <i class="fa fa-file-text-o"></i>
+ </span>
+ <?php endif ?>
+
</div>
</th>
<?php endif ?>
diff --git a/app/Template/swimlane/edit.php b/app/Template/swimlane/edit.php
index 1788fed2..dfc5cf0b 100644
--- a/app/Template/swimlane/edit.php
+++ b/app/Template/swimlane/edit.php
@@ -12,6 +12,27 @@
<?= $this->form->label(t('Name'), 'name') ?>
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
+ <?= $this->form->label(t('Description'), 'description') ?>
+
+ <div class="form-tabs">
+
+ <div class="write-area">
+ <?= $this->form->textarea('description', $values, $errors) ?>
+ </div>
+ <div class="preview-area">
+ <div class="markdown"></div>
+ </div>
+ <ul class="form-tabs-nav">
+ <li class="form-tab form-tab-selected">
+ <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
+ </li>
+ <li class="form-tab">
+ <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
+ </li>
+ </ul>
+ </div>
+ <div class="form-help"><?= $this->url->doc(t('Write your text in Markdown'), 'syntax-guide') ?></div>
+
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
diff --git a/app/Template/swimlane/index.php b/app/Template/swimlane/index.php
index daee6af5..1bf31afa 100644
--- a/app/Template/swimlane/index.php
+++ b/app/Template/swimlane/index.php
@@ -16,6 +16,26 @@
<?= $this->form->label(t('Name'), 'name') ?>
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
+ <?= $this->form->label(t('Description'), 'description') ?>
+
+ <div class="form-tabs">
+ <div class="write-area">
+ <?= $this->form->textarea('description', $values, $errors) ?>
+ </div>
+ <div class="preview-area">
+ <div class="markdown"></div>
+ </div>
+ <ul class="form-tabs-nav">
+ <li class="form-tab form-tab-selected">
+ <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
+ </li>
+ <li class="form-tab">
+ <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
+ </li>
+ </ul>
+ </div>
+ <div class="form-help"><?= $this->url->doc(t('Write your text in Markdown'), 'syntax-guide') ?></div>
+
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
diff --git a/app/Template/swimlane/table.php b/app/Template/swimlane/table.php
index f38572a3..b708e633 100644
--- a/app/Template/swimlane/table.php
+++ b/app/Template/swimlane/table.php
@@ -25,7 +25,7 @@
</li>
<?php endif ?>
<li>
- <?= $this->url->link(t('Rename'), 'swimlane', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
+ <?= $this->url->link(t('Edit'), 'swimlane', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
</li>
<li>
<?php if ($swimlane['is_active']): ?>
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)));