summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--tests/units/Core/Filter/LexerBuilderTest.php25
2 files changed, 29 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 44dd12a7..d15db403 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,10 @@ Improvements:
* Comments are highlighted if hash (#comment-123) is present in URL
* Documentation translated in Turkish
+Bug fixes:
+
+* Search with multiple expressions with double quotes was not working
+
Version 1.0.38 (Jan 28, 2017)
-----------------------------
diff --git a/tests/units/Core/Filter/LexerBuilderTest.php b/tests/units/Core/Filter/LexerBuilderTest.php
index 31e237dc..82d359d6 100644
--- a/tests/units/Core/Filter/LexerBuilderTest.php
+++ b/tests/units/Core/Filter/LexerBuilderTest.php
@@ -149,4 +149,29 @@ class LexerBuilderTest extends Base
$this->assertEquals('Test 1', $tasks[0]['title']);
$this->assertEquals('Test 2', $tasks[1]['title']);
}
+
+ public function testWithMultipleExpressionsWithQuotes()
+ {
+ $taskFinder = new TaskFinderModel($this->container);
+ $taskCreation = new TaskCreationModel($this->container);
+ $projectModel = new ProjectModel($this->container);
+ $userModel = new UserModel($this->container);
+ $query = $taskFinder->getExtendedQuery();
+
+ $this->assertEquals(2, $userModel->create(array('username' => 'foobar', 'name' => 'Foo Bar')));
+ $this->assertEquals(1, $projectModel->create(array('name' => 'Test')));
+ $this->assertEquals(1, $taskCreation->create(array('title' => 'Test 1', 'project_id' => 1, 'owner_id' => 2)));
+ $this->assertEquals(2, $taskCreation->create(array('title' => 'Test 2', 'project_id' => 1, 'owner_id' => 1)));
+ $this->assertEquals(3, $taskCreation->create(array('title' => 'Test 3', 'project_id' => 1, 'owner_id' => 0)));
+
+ $builder = new LexerBuilder();
+ $builder->withFilter(new TaskAssigneeFilter());
+ $builder->withFilter(new TaskTitleFilter(), true);
+ $builder->withQuery($query);
+ $tasks = $builder->build('assignee:"admin" assignee:"foobar"')->toArray();
+
+ $this->assertCount(2, $tasks);
+ $this->assertEquals('Test 1', $tasks[0]['title']);
+ $this->assertEquals('Test 2', $tasks[1]['title']);
+ }
}