Skip to content

Commit

Permalink
Fix SysVQueue test
Browse files Browse the repository at this point in the history
  • Loading branch information
rybakit committed Sep 12, 2014
1 parent ff49469 commit 2b2a606
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/Queue/SysVQueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,29 @@ public function testThrowExceptionOnMissingResource($method)
}

/**
* @requires uopz
* @requires extension uopz
* @dataProvider provideQueueInterfaceMethods
*/
public function testThrowExceptionOnInabilityToCreateResource($method)
{
uopz_backup('msg_get_queue');
uopz_function('msg_get_queue', function () { return false; });

$failed = true;
$passed = false;

try {
// suppress notices/warnings triggered by msg_* functions
// to avoid a PHPUnit_Framework_Error_Notice exception be thrown
@$this->callQueueMethod($this->queue, $method);
} catch (NoItemAvailableException $e) {
} catch (QueueException $e) {
$failed = false;
$this->assertSame('Failed to create/attach to the queue.', $e->getMessage());
$passed = true;
}

uopz_restore('msg_get_queue');

if ($failed) {
if (!$passed) {
$this->fail();
}
}
Expand Down

0 comments on commit 2b2a606

Please sign in to comment.