11 use PhpAmqpLib\Exception\AMQPLogicException;
12 use Psr\Log\LoggerInterface;
22 private $topologyInstaller;
27 private $objectManager;
32 private $topologyConfigMock;
45 $this->topologyConfigMock = $this->createMock(ConfigInterface::class);
46 $this->loggerMock = $this->createMock(LoggerInterface::class);
47 $this->topologyInstaller = $this->objectManager->getObject(
48 TopologyInstaller::class,
49 [
'topologyConfig' => $this->topologyConfigMock,
'logger' => $this->loggerMock]
59 $exceptionMessage =
"Exception message";
61 $this->topologyConfigMock
62 ->expects($this->once())
64 ->willThrowException(
new AMQPLogicException($exceptionMessage));
67 ->expects($this->once())
69 ->with($this->stringContains(
"AMQP topology installation failed: {$exceptionMessage}"));
71 $this->topologyInstaller->install();