/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/Sales/CustomerData/LastOrderedItemsTest.php
48 строк
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\Sales\CustomerData; use Magento\Framework\ObjectManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; use Magento\Customer\Model\Session; /** * @magentoAppIsolation enabled */ class LastOrderedItemsTest extends TestCase { /** * @var ObjectManagerInterface */ private $objectManager; protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); } /** * @magentoDataFixture Magento/Sales/_files/order_with_customer_and_multiple_order_items.php */ public function testDefaultFormatterIsAppliedWhenBasicIntegration() { /** @var Session $customerSession */ $customerSession = $this->objectManager->get(Session::class); $customerSession->loginById(1); /** @var LastOrderedItems $customerDataSectionSource */ $customerDataSectionSource = $this->objectManager->get(LastOrderedItems::class); $data = $customerDataSectionSource->getSectionData(); $this->assertEquals( LastOrderedItems::SIDEBAR_ORDER_LIMIT, count($data['items']), 'Section items count should not be greater than ' . LastOrderedItems::SIDEBAR_ORDER_LIMIT ); } }