Merge pull request #29 from tolry/allow-dots-in-projects-and-tasks
allow dots in projects and tags
This commit is contained in:
commit
1495e8bcc1
|
@ -24,10 +24,11 @@ use ProxyManager\Proxy\ValueHolderInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author David Badura <d.a.badura@gmail.com>
|
* @author David Badura <d.a.badura@gmail.com>
|
||||||
|
* @author Tobias Olry <tobias.olry@gmail.com>
|
||||||
*/
|
*/
|
||||||
class TaskManager
|
class TaskManager
|
||||||
{
|
{
|
||||||
const PATTERN = '/^[\wäüö]*$/i';
|
const PATTERN = '/^[\wäüö\.]*$/i';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Taskwarrior
|
* @var Taskwarrior
|
||||||
|
|
|
@ -9,7 +9,8 @@ use DavidBadura\Taskwarrior\Taskwarrior;
|
||||||
use Symfony\Component\Filesystem\Filesystem;
|
use Symfony\Component\Filesystem\Filesystem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author David Badura <badura@simplethings.de>
|
* @author David Badura <d.a.badura@gmail.com>
|
||||||
|
* @author Tobias Olry <tobias.olry@gmail.com>
|
||||||
*/
|
*/
|
||||||
class TaskManagerTest extends \PHPUnit_Framework_TestCase
|
class TaskManagerTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
@ -548,7 +549,7 @@ class TaskManagerTest extends \PHPUnit_Framework_TestCase
|
||||||
$this->assertEquals(array('später'), $task1->getTags());
|
$this->assertEquals(array('später'), $task1->getTags());
|
||||||
$this->assertEquals(array('später'), $this->taskwarrior->tags());
|
$this->assertEquals(array('später'), $this->taskwarrior->tags());
|
||||||
|
|
||||||
$this->assertCount(1,$this->taskManager->filterPending('+später'));
|
$this->assertCount(1, $this->taskManager->filterPending('+später'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTagNameNotAllowed()
|
public function testTagNameNotAllowed()
|
||||||
|
@ -563,6 +564,33 @@ class TaskManagerTest extends \PHPUnit_Framework_TestCase
|
||||||
$this->taskManager->save($task1);
|
$this->taskManager->save($task1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function provideProjectNames()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
['grandparent.parent.child'],
|
||||||
|
['parent.child'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider provideProjectNames
|
||||||
|
*/
|
||||||
|
public function testProjectHierarchyAllowed($project)
|
||||||
|
{
|
||||||
|
$task = new Task();
|
||||||
|
$task->setDescription('foo1');
|
||||||
|
$task->setProject($project);
|
||||||
|
|
||||||
|
// no exception thrown
|
||||||
|
$this->taskManager->save($task);
|
||||||
|
|
||||||
|
// refetch the task
|
||||||
|
$this->taskManager->clear();
|
||||||
|
$task = $this->taskManager->find($task->getUuid());
|
||||||
|
|
||||||
|
$this->assertEquals($project, $task->getProject());
|
||||||
|
}
|
||||||
|
|
||||||
public function testWait()
|
public function testWait()
|
||||||
{
|
{
|
||||||
$task1 = new Task();
|
$task1 = new Task();
|
||||||
|
|
Loading…
Reference in New Issue