/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/MessageQueue/Test/Unit/DefaultValueProviderTest.php
81 строка
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2022 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\MessageQueue\Test\Unit; use Magento\Framework\App\DeploymentConfig; use Magento\Framework\MessageQueue\DefaultValueProvider; use PHPUnit\Framework\TestCase; class DefaultValueProviderTest extends TestCase { /** * @var DeploymentConfig */ private $config; /** * @var DefaultValueProvider */ private DefaultValueProvider $model; /** * @return void */ protected function setUp(): void { $this->config = $this->getMockBuilder(DeploymentConfig::class) ->disableOriginalConstructor() ->getMock(); $this->model = new DefaultValueProvider('db', 'magento', $this->config); } /** * @return void */ public function testGetConnection(): void { $this->config->method('get')->willReturnMap( [ ['queue', null, ['key' => 'test_connection']], ] ); $this->assertEquals('db', $this->model->getConnection()); } /** * @return void * */ public function testGetDefaultConnection(): void { $this->config->method('get')->willReturnMap( [ ['queue/default_connection', null, 'test_connection'], ] ); $this->assertEquals('test_connection', $this->model->getConnection()); } /** * @return void * */ public function testGetAMQPConnection(): void { $this->config->method('get')->willReturnMap( [ ['queue/default_connection', null, null], ['queue/amqp', null, ['host' => '127.0.0.1', 'port' => '5672']], ['queue', null, ['amqp' => ['host' => '127.0.0.1', 'port' => '5672']]] ] ); $this->assertEquals('amqp', $this->model->getConnection()); } }