diff options
| author | Gerardo Zamudio <gerardozamudio@users.noreply.github.com> | 2016-02-24 23:48:50 -0600 |
|---|---|---|
| committer | Gerardo Zamudio <gerardozamudio@users.noreply.github.com> | 2016-02-24 23:48:50 -0600 |
| commit | e4de6b3898b64b26d29aff31f21df5fda8055686 (patch) | |
| tree | 575f8a65440f291d70a070d168eafca8c82a6459 /tests/units/Model/TaskMovedDateSubscriberTest.php | |
| parent | d9ffbea174ea6524d0a22f8375ca8b3aa04a3c96 (diff) | |
| parent | a6540bc604c837d92c9368540c145606723e97f7 (diff) | |
Merge pull request #1 from fguillot/master
Update from upstream
Diffstat (limited to 'tests/units/Model/TaskMovedDateSubscriberTest.php')
| -rw-r--r-- | tests/units/Model/TaskMovedDateSubscriberTest.php | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/tests/units/Model/TaskMovedDateSubscriberTest.php b/tests/units/Model/TaskMovedDateSubscriberTest.php deleted file mode 100644 index 0dd6e995..00000000 --- a/tests/units/Model/TaskMovedDateSubscriberTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -require_once __DIR__.'/../Base.php'; - -use Kanboard\Model\TaskPosition; -use Kanboard\Model\TaskCreation; -use Kanboard\Model\TaskFinder; -use Kanboard\Model\Project; -use Kanboard\Model\Swimlane; -use Kanboard\Subscriber\TaskMovedDateSubscriber; -use Symfony\Component\EventDispatcher\EventDispatcher; - -class TaskMovedDateSubscriberTest extends Base -{ - public function testMoveTaskAnotherColumn() - { - $tp = new TaskPosition($this->container); - $tc = new TaskCreation($this->container); - $p = new Project($this->container); - $tf = new TaskFinder($this->container); - - $this->container['dispatcher'] = new EventDispatcher; - $this->container['dispatcher']->addSubscriber(new TaskMovedDateSubscriber($this->container)); - - $now = time(); - - $this->assertEquals(1, $p->create(array('name' => 'Project #1'))); - $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1))); - - $task = $tf->getById(1); - $this->assertNotEmpty($task); - $this->assertEquals($now, $task['date_moved'], '', 1); - - sleep(1); - - $this->assertTrue($tp->movePosition(1, 1, 2, 1)); - - $task = $tf->getById(1); - $this->assertNotEmpty($task); - $this->assertNotEquals($now, $task['date_moved']); - } - - public function testMoveTaskAnotherSwimlane() - { - $tp = new TaskPosition($this->container); - $tc = new TaskCreation($this->container); - $p = new Project($this->container); - $tf = new TaskFinder($this->container); - $s = new Swimlane($this->container); - - $this->container['dispatcher'] = new EventDispatcher; - $this->container['dispatcher']->addSubscriber(new TaskMovedDateSubscriber($this->container)); - - $now = time(); - - $this->assertEquals(1, $p->create(array('name' => 'Project #1'))); - $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); - $this->assertNotEmpty($task); - $this->assertEquals($now, $task['date_moved'], '', 1); - $this->assertEquals(1, $task['column_id']); - $this->assertEquals(0, $task['swimlane_id']); - - sleep(1); - - $this->assertTrue($tp->movePosition(1, 1, 2, 1, 2)); - - $task = $tf->getById(1); - $this->assertNotEmpty($task); - $this->assertNotEquals($now, $task['date_moved']); - $this->assertEquals(2, $task['column_id']); - $this->assertEquals(2, $task['swimlane_id']); - } -} |
