fix description

This commit is contained in:
DavidBadura
2015-06-28 13:11:00 +00:00
parent d6c82c04e7
commit fb763a765e
3 changed files with 26 additions and 17 deletions

View File

@@ -69,30 +69,38 @@ class TaskManagerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($task, $result);
}
public function testUrlInDescription()
public function provideDescriptions()
{
$task = new Task();
$task->setDescription('hier http://google.de ');
$this->taskManager->save($task);
$this->taskManager->clear();
$result = $this->taskManager->find($task->getUuid());
$this->assertEquals('hier http://google.de ', $result->getDescription());
return array(
array('hier http://google.de'),
array("test ' foo"),
array("test (foo) bar"),
array("foo-bar"),
array("test +bar")
);
}
public function testQuoteInDescription()
/**
* @dataProvider provideDescriptions
*/
public function testDescription($description)
{
$task = new Task();
$task->setDescription(" test ' foo ");
$task->setDescription($description);
$this->taskManager->save($task);
$this->taskManager->clear();
$result = $this->taskManager->find($task->getUuid());
$task = $this->taskManager->find($task->getUuid());
$this->assertEquals(" test ' foo ", $result->getDescription());
$this->assertEquals($description, $task->getDescription());
$this->taskManager->save($task);
$this->taskManager->clear();
$task = $this->taskManager->find($task->getUuid());
$this->assertEquals($description, $task->getDescription());
}
public function testSaveTaskWithoutDescription()