ensure false is returned when DontCreate is thrown

This commit is contained in:
Chris Boulton 2015-02-02 12:30:40 -08:00
parent 8007705221
commit 0c39e2ca7a

View File

@ -106,9 +106,10 @@ class Resque_Tests_EventTest extends Resque_Tests_TestCase
Resque_Event::listen('beforeEnqueue', array($this, $callback)); Resque_Event::listen('beforeEnqueue', array($this, $callback));
Resque_Event::listen('afterEnqueue', array($this, 'afterEnqueueEventCallback')); Resque_Event::listen('afterEnqueue', array($this, 'afterEnqueueEventCallback'));
Resque::enqueue('test_job', 'TestClass'); $result = Resque::enqueue('test_job', 'TestClass');
$this->assertContains($callback, $this->callbacksHit, $callback . ' callback was not called'); $this->assertContains($callback, $this->callbacksHit, $callback . ' callback was not called');
$this->assertNotContains('afterEnqueueEventCallback', $this->callbacksHit, 'afterEnqueue was still called, even though it should not have been'); $this->assertNotContains('afterEnqueueEventCallback', $this->callbacksHit, 'afterEnqueue was still called, even though it should not have been');
$this->assertFalse($result);
} }
public function testAfterEnqueueEventCallbackFires() public function testAfterEnqueueEventCallbackFires()