allow dots in projects and tasks

This commit is contained in:
Tobias Olry 2015-07-25 11:02:18 +02:00
parent d3926a9904
commit d18a3acca8
2 changed files with 20 additions and 3 deletions

View File

@ -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

View File

@ -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,21 @@ class TaskManagerTest extends \PHPUnit_Framework_TestCase
$this->taskManager->save($task1); $this->taskManager->save($task1);
} }
public function testProjectHierarchyAllowed()
{
$projects = ['grandparent.parent.child', 'parent.child'];
foreach ($projects as $project) {
$task = new Task();
$task->setDescription('foo1');
$task->setProject($project);
// now exception thrown
$this->taskManager->save($task);
$this->assertEquals($project, $task->getProject());
}
}
public function testWait() public function testWait()
{ {
$task1 = new Task(); $task1 = new Task();