Added an injectable endpoint
Allows for injecting endpoints to simulate poor responses while still testing the responses from the actual endpoint.
This commit is contained in:
parent
abe73f66a4
commit
5d7f3a0e5a
2 changed files with 26 additions and 2 deletions
|
@ -24,6 +24,29 @@ class API_Google_ProfanityTest extends PHPUnit_Framework_TestCase
|
|||
['cuntface', false], // Unsure why not...
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid response from API.
|
||||
*/
|
||||
public function testNullResponse()
|
||||
{
|
||||
$file = SITE_PATH . 'null-';
|
||||
|
||||
file_put_contents($file . 'test', null);
|
||||
|
||||
API_Google_Profanity::check('test', $file);
|
||||
}
|
||||
|
||||
public function testMissingResponse()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testInvalidResponse()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue