This commit is contained in:
2026-09-15 10:26:34 +08:00
commit ecf36afa56
10493 changed files with 1404888 additions and 0 deletions
@@ -0,0 +1,44 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Backend\Block\Dashboard\Orders;
use Magento\Backend\Block\Template\Context;
class GridTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Grid
*/
private $block;
protected function setUp(): void
{
parent::setUp();
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$block = $this->createMock(\Magento\Backend\Block\Dashboard\Orders\Grid::class);
$layout = $this->createMock(\Magento\Framework\View\LayoutInterface::class);
$layout->expects($this->atLeastOnce())->method('getChildName')->willReturn('test');
$layout->expects($this->atLeastOnce())->method('getBlock')->willReturn($block);
$context = $objectManager->create(Context::class, ['layout' => $layout]);
$this->block = $objectManager->create(Grid::class, ['context' => $context]);
}
/**
* @magentoDataFixture Magento/Sales/_files/order.php
*/
public function testGetPreparedCollection()
{
$collection = $this->block->getPreparedCollection();
foreach ($collection->getItems() as $item) {
if ($item->getIncrementId() == '100000001') {
$this->assertEquals('firstname lastname', $item->getCustomer());
}
}
}
}