/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/GiftMessage/Observer/SalesEventQuoteMergeTest.php
40 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 10:44
22 окт 2025, 10:44
264bea2
Код
Авторство
О чём код?
<?php /** * Copyright 2018 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\GiftMessage\Observer; use Magento\TestFramework\Helper\Bootstrap; use Magento\Framework\Event\ManagerInterface; use Magento\Quote\Model\QuoteFactory; use Magento\Quote\Model\Quote; class SalesEventQuoteMergeTest extends \PHPUnit\Framework\TestCase { /** * @magentoAppArea frontend */ public function testQuoteMerge() { $giftMessageId = 6; $objectManager = Bootstrap::getObjectManager(); $eventManager = $objectManager->get(ManagerInterface::class); /** @var Quote $sourceQuote */ $sourceQuote = $objectManager->create(QuoteFactory::class)->create(); $targetQuote = clone($sourceQuote); $sourceQuote->setGiftMessageId($giftMessageId); $eventManager->dispatch( 'sales_quote_merge_after', [ 'quote' => $targetQuote, 'source' => $sourceQuote ] ); self::assertEquals($giftMessageId, $targetQuote->getGiftMessageId()); } }