| 1 | <?php |
||
| 18 | class SimpleQueueManagerTest extends PHPUnit_Framework_TestCase |
||
| 19 | { |
||
| 20 | public function test() |
||
| 21 | { |
||
| 22 | $command = $this->getMockBuilder(CommandInterface::class)->getMock(); |
||
| 23 | $qm = new SimpleQueueManager(); |
||
| 24 | $processorFactory = new ProcessorFactory(); |
||
| 25 | $driver = new DirectProcessingDriver(); |
||
| 26 | $driver->setProcessorFactory($processorFactory); |
||
| 27 | $qm->setSendDriver($driver); |
||
| 28 | $qm->sendCommand($command); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function testNoSendDriver() |
||
| 32 | { |
||
| 33 | $this->setExpectedException(RuntimeException::class, 'Send driver not set'); |
||
| 34 | $command = $this->getMockBuilder(CommandInterface::class)->getMock(); |
||
| 35 | $qm = new SimpleQueueManager(); |
||
| 36 | $qm->sendCommand($command); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |