Taskwarrior/tests/Query/QueryBuilderTest.php

37 lines
925 B
PHP
Raw Normal View History

2015-04-06 16:49:38 -05:00
<?php
2015-04-23 16:28:57 -05:00
namespace DavidBadura\Taskwarrior\Test\Query;
2015-04-06 16:49:38 -05:00
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();
2015-04-23 16:28:57 -05:00
$this->assertEquals(['project:testProject', '+testTag', 'status:testStatus', 'priority:testPriority'], $filter);
2015-04-06 16:49:38 -05:00
}
}