From 7fe643de81043af2a9fae237530f66a1b6ac9fe4 Mon Sep 17 00:00:00 2001 From: Jurian Sluiman Date: Mon, 21 Apr 2014 11:54:25 +0200 Subject: [PATCH] Catch the exception and test its type directly --- .../SlmQueueBeanstalkdTest/Worker/BeanstalkdWorkerTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/SlmQueueBeanstalkdTest/Worker/BeanstalkdWorkerTest.php b/tests/SlmQueueBeanstalkdTest/Worker/BeanstalkdWorkerTest.php index 2e6dfc9..c3615a9 100644 --- a/tests/SlmQueueBeanstalkdTest/Worker/BeanstalkdWorkerTest.php +++ b/tests/SlmQueueBeanstalkdTest/Worker/BeanstalkdWorkerTest.php @@ -76,7 +76,10 @@ public function testOnlyBeanstalkdQueuesAreAllowed() $queue = $this->getMock('SlmQueue\Queue\QueueInterface'); $job = new Asset\SimpleJob(); - $this->setExpectedException('SlmQueueBeanstalkd\Exception\ExceptionInterface'); - $this->worker->processJob($job, $queue); + try { + $this->worker->processJob($job, $queue); + } catch (\Exception $e) { + $this->assertInstanceOf('SlmQueueBeanstalkd\Exception\ExceptionInterface', $e); + } } }