-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⏫ Forwardport of #12241 to 2.3-develop branch
Applied pull request patch https://github.com/magento/magento2/pull/12241.patch (created by @RomaKis) based on commit(s): 1. ef165a2 2. f11c0db 3. 1ebcd7a 4. a933cf7 5. f8ed60f Fixed GitHub Issues in 2.3-develop branch: - #10128: New Orders not being saved to order grid (reported by @joergmaertin)
- Loading branch information
1 parent
8e77e2f
commit 742819b
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
dev/tests/integration/testsuite/Magento/Backend/Block/Dashboard/Orders/GridTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
{ | ||
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()); | ||
} | ||
} | ||
} | ||
} |