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:
Joshua Sherman 2014-01-11 19:07:29 -05:00
parent abe73f66a4
commit 5d7f3a0e5a
2 changed files with 26 additions and 2 deletions

View file

@ -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()
{
}
}
?>