Add description attribute for advanced search

This commit is contained in:
Frederic Guillot
2015-06-28 21:04:37 -04:00
parent 2e7e703180
commit 7c1222fc59
5 changed files with 80 additions and 16 deletions

View File

@@ -96,6 +96,26 @@ class LexerTest extends Base
);
}
public function testDescriptionQuery()
{
$lexer = new Lexer;
$this->assertEquals(
array(array('match' => 'description:', 'token' => 'T_DESCRIPTION'), array('match' => 'my text search', 'token' => 'T_STRING')),
$lexer->tokenize('description:"my text search"')
);
$this->assertEquals(
array('T_DESCRIPTION' => 'my text search'),
$lexer->map($lexer->tokenize('description:"my text search"'))
);
$this->assertEquals(
array(),
$lexer->map($lexer->tokenize('description: '))
);
}
public function testDueDateQuery()
{
$lexer = new Lexer;