mardi 3 mars 2015

Test cases to test a function phpunit

I'm new to php unit testing, What are the valid test cases for below function.



protected function validateParams($graph, $start, $destination)
{
if (!is_object($graph)) {

throw new \InvalidArgumentException('Graph param should be an object !');
}

if (empty($start)) {

throw new \InvalidArgumentException('Start param is empty !');
}

if (empty($destination)) {

throw new \InvalidArgumentException('Graph param is empty !');
}

return true;
}

Aucun commentaire:

Enregistrer un commentaire