Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigPoolTest.php
Go to the documentation of this file.
1 <?php
7 
8 class ConfigPoolTest extends \PHPUnit\Framework\TestCase
9 {
10  public function testGetConnection()
11  {
12  $factory = $this->createMock(\Magento\Framework\Amqp\ConfigFactory::class);
13  $config = $this->createMock(\Magento\Framework\Amqp\Config::class);
14  $factory->expects($this->once())->method('create')->with(['connectionName' => 'amqp'])->willReturn($config);
15  $model = new \Magento\Framework\Amqp\ConfigPool($factory);
16  $this->assertEquals($config, $model->get('amqp'));
17  //test that object is cached
18  $this->assertEquals($config, $model->get('amqp'));
19  }
20 }
$config
Definition: fraud_order.php:17