public function testThrowExceptionOnInabilityToCreateResource($method)
{
uopz_backup('msg_get_queue');
uopz_function('msg_get_queue', function () {
return false;
});
$passed = false;
try {
// suppress notices/warnings triggered by msg_* functions
// to avoid a PHPUnit_Framework_Error_Notice to be thrown
@$this->callQueueMethod($this->queue, $method);
} catch (NoItemAvailableException $e) {
} catch (QueueException $e) {
$this->assertSame('Failed to create/attach to the queue.', $e->getMessage());
$passed = true;
}
uopz_restore('msg_get_queue');
if (!$passed) {
$this->fail();
}
}