clear taskamanager and refetch data before asserting data was saved, extract test data into dataProvider
This commit is contained in:
		@@ -564,20 +564,32 @@ class TaskManagerTest extends \PHPUnit_Framework_TestCase
 | 
			
		||||
        $this->taskManager->save($task1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testProjectHierarchyAllowed()
 | 
			
		||||
    public function provideProjectNames()
 | 
			
		||||
    {
 | 
			
		||||
        return [
 | 
			
		||||
            ['grandparent.parent.child'],
 | 
			
		||||
            ['parent.child'],
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @dataProvider provideProjectNames
 | 
			
		||||
     */
 | 
			
		||||
    public function testProjectHierarchyAllowed($project)
 | 
			
		||||
    {
 | 
			
		||||
        $projects = ['grandparent.parent.child', 'parent.child'];
 | 
			
		||||
        foreach ($projects as $project) {
 | 
			
		||||
        $task = new Task();
 | 
			
		||||
        $task->setDescription('foo1');
 | 
			
		||||
        $task->setProject($project);
 | 
			
		||||
 | 
			
		||||
            // now exception thrown
 | 
			
		||||
        // 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()
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user