From 23d862aef8891130bc7eaeaa25513a9895b44c95 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 3 Dec 2016 12:56:12 -0500 Subject: Add suggest menu for task ID --- .../Formatter/TaskSuggestMenuFormatterTest.php | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/units/Formatter/TaskSuggestMenuFormatterTest.php (limited to 'tests/units/Formatter/TaskSuggestMenuFormatterTest.php') diff --git a/tests/units/Formatter/TaskSuggestMenuFormatterTest.php b/tests/units/Formatter/TaskSuggestMenuFormatterTest.php new file mode 100644 index 00000000..d247d670 --- /dev/null +++ b/tests/units/Formatter/TaskSuggestMenuFormatterTest.php @@ -0,0 +1,39 @@ +container); + $taskCreationModel = new TaskCreationModel($this->container); + $taskSuggestMenuFormatter = new TaskSuggestMenuFormatter($this->container); + + $this->assertEquals(1, $projectModel->create(array('name' => 'My Project'))); + $this->assertEquals(1, $taskCreationModel->create(array('title' => 'Task 1', 'project_id' => 1))); + $this->assertEquals(2, $taskCreationModel->create(array('title' => 'Task 2', 'project_id' => 1))); + + $result = $taskSuggestMenuFormatter + ->withQuery($this->container['taskFinderModel']->getExtendedQuery()) + ->format() + ; + + $expected = array( + array( + 'value' => '1', + 'html' => '#1 Task 1 My Project', + ), + array( + 'value' => '2', + 'html' => '#2 Task 2 My Project', + ), + ); + + $this->assertSame($expected, $result); + } +} -- cgit v1.2.3