Taskwarrior/tests/QueryBuilderTest.php

37 lines
908 B
PHP
Raw Normal View History

2015-04-06 16:49:38 -05:00
<?php
namespace DavidBadura\Taskwarrior\Test;
2015-04-23 14:09:52 -05:00
use DavidBadura\Taskwarrior\Query\QueryBuilder;
2015-04-06 16:49:38 -05:00
/**
* @author David Badura <badura@simplethings.de>
*/
class QueryBuilderTest extends \PHPUnit_Framework_TestCase
{
/**
* @var QueryBuilder
*/
protected $builder;
public function setUp()
{
$taskManager = $this->getMockBuilder('DavidBadura\Taskwarrior\TaskManager')
->disableOriginalConstructor()
->getMock();
$this->builder = new QueryBuilder($taskManager);
}
public function testWhere()
{
$filter = $this->builder
->whereProject('testProject')
->whereTag('testTag')
->whereStatus('testStatus')
->wherePriority('testPriority')
->getFilter();
$this->assertEquals('project:testProject +testTag status:testStatus priority:testPriority', $filter);
}
}