-
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 #11397 to 2.3-develop branch
Applied pull request patch https://github.com/magento/magento2/pull/11397.patch (created by @michielgerritsen) based on commit(s): 1. 9ee464c 2. 8e843ad 3. 69ef9da 4. 4660956 5. 567b331 6. 1ad99bc 7. 0784f58 Fixed GitHub Issues in 2.3-develop branch: - #9566: Status label is wrong in admin (reported by @darkogoles1)
- Loading branch information
1 parent
8e77e2f
commit 88a3ad0
Showing
5 changed files
with
125 additions
and
6 deletions.
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
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
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
49 changes: 49 additions & 0 deletions
49
dev/tests/integration/testsuite/Magento/Sales/Model/Order/StatusTest.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,49 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Sales\Model\Order; | ||
|
||
/** | ||
* Class ShipmentTest | ||
* @package Magento\Sales\Model\Order | ||
*/ | ||
class StatusTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
public function theCorrectLabelIsUsedDependingOnTheAreaProvider() | ||
{ | ||
return [ | ||
'backend label' => [ | ||
'adminhtml', | ||
'Example', | ||
], | ||
'store view label' => [ | ||
'frontend', | ||
'Store view example', | ||
], | ||
]; | ||
} | ||
|
||
/** | ||
* In the backend the regular label must be showed. | ||
* | ||
* @param $area | ||
* @param $result | ||
* | ||
* @magentoDataFixture Magento/Sales/_files/order_status.php | ||
* @dataProvider theCorrectLabelIsUsedDependingOnTheAreaProvider | ||
*/ | ||
public function testTheCorrectLabelIsUsedDependingOnTheArea($area, $result) | ||
{ | ||
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); | ||
$objectManager->get(\Magento\Framework\App\State::class)->setAreaCode($area); | ||
|
||
/** @var \Magento\Sales\Model\Order $order */ | ||
$order = $objectManager->create(\Magento\Sales\Model\Order::class); | ||
$order->loadByIncrementId('100000001'); | ||
|
||
$this->assertEquals($result, $order->getStatusLabel()); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
dev/tests/integration/testsuite/Magento/Sales/_files/order_status.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,25 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
require __DIR__ . '/order.php'; | ||
|
||
$orderStatus = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( | ||
\Magento\Sales\Model\Order\Status::class | ||
); | ||
|
||
$data = [ | ||
'status' => 'example', | ||
'label' => 'Example', | ||
'store_labels' => [ | ||
1 => 'Store view example', | ||
] | ||
]; | ||
|
||
$orderStatus->setData($data)->setStatus('example'); | ||
$orderStatus->save(); | ||
|
||
$order->setStatus('example'); | ||
$order->save(); |