Add unit test for PR #2766
This commit is contained in:
@@ -11,6 +11,10 @@ Improvements:
|
|||||||
* Comments are highlighted if hash (#comment-123) is present in URL
|
* Comments are highlighted if hash (#comment-123) is present in URL
|
||||||
* Documentation translated in Turkish
|
* Documentation translated in Turkish
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
|
||||||
|
* Search with multiple expressions with double quotes was not working
|
||||||
|
|
||||||
Version 1.0.38 (Jan 28, 2017)
|
Version 1.0.38 (Jan 28, 2017)
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -149,4 +149,29 @@ class LexerBuilderTest extends Base
|
|||||||
$this->assertEquals('Test 1', $tasks[0]['title']);
|
$this->assertEquals('Test 1', $tasks[0]['title']);
|
||||||
$this->assertEquals('Test 2', $tasks[1]['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']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user