Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
QueueInstallerTest.php
Go to the documentation of this file.
1 <?php
7 
10 use PhpAmqpLib\Channel\AMQPChannel;
11 
12 class QueueInstallerTest extends \PHPUnit\Framework\TestCase
13 {
14  public function testInstall()
15  {
16  $bindingInstaller = $this->createMock(QueueConfigItemInterface::class);
17  $model = new QueueInstaller($bindingInstaller);
18  $channel = $this->createMock(AMQPChannel::class);
19 
20  $queue = $this->createMock(QueueConfigItemInterface::class);
21  $queue->expects($this->once())->method('getName')->willReturn('queue01');
22  $queue->expects($this->once())->method('isDurable')->willReturn(true);
23  $queue->expects($this->once())->method('isAutoDelete')->willReturn(false);
24  $queue->expects($this->once())->method('getArguments')->willReturn(['some' => 'value']);
25 
26  $channel->expects($this->once())
27  ->method('queue_declare')
28  ->with('queue01', false, true, false, false, false, ['some' => ['S', 'value']], null);
29  $model->install($channel, $queue);
30  }
31 }
$queue
Definition: queue.php:21