1 | <?php |
||
16 | class AMQPBackendTest extends \PHPUnit_Framework_TestCase |
||
17 | { |
||
18 | public function setUp() |
||
24 | |||
25 | public function testQueue() |
||
35 | |||
36 | public function testDefaultQueue() |
||
43 | |||
44 | /** |
||
45 | * @expectedException \RuntimeException |
||
46 | */ |
||
47 | public function testDefaultQueueNotFound() |
||
48 | { |
||
49 | $mock = $this->getMockQueue('foo', 'message.type.foo', $this->never()); |
||
50 | $fooBackend = array('type' => 'message.type.foo', 'backend' => $mock); |
||
51 | $dispatcher = $this->getDispatcher(array($fooBackend)); |
||
52 | $dispatcher->createAndPublish('some.other.type', array()); |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @expectedException \RuntimeException |
||
57 | */ |
||
58 | public function testInvalidQueue() |
||
59 | { |
||
60 | $mock = $this->getMockQueue('foo', 'message.type.bar'); |
||
61 | $dispatcher = $this->getDispatcher(array(array('type' => 'bar', 'backend' => $mock)), 'foo', 'message.type.bar'); |
||
62 | $dispatcher->createAndPublish('message.type.bar', array()); |
||
63 | } |
||
64 | |||
65 | protected function getMockQueue($queue, $type, $called = null) |
||
79 | |||
80 | protected function getDispatcher(array $backends, $queue = 'foo', $key = 'message.type.foo') |
||
93 | } |
||
94 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.