|
12 | 12 | */
|
13 | 13 | class StatusTest extends \PHPUnit\Framework\TestCase
|
14 | 14 | {
|
15 |
| - /** |
16 |
| - * In the backend the regular label must be showed. |
17 |
| - * |
18 |
| - * @magentoDataFixture Magento/Sales/_files/order_status.php |
19 |
| - */ |
20 |
| - public function testTheLabelIsUsedInTheBackend() |
| 15 | + public function theCorrectLabelIsUsedDependingOnTheAreaProvider() |
21 | 16 | {
|
22 |
| - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); |
23 |
| - $objectManager->get(\Magento\Framework\App\State::class)->setAreaCode('adminhtml'); |
24 |
| - |
25 |
| - /** @var \Magento\Sales\Model\Order $order */ |
26 |
| - $order = $objectManager->create(\Magento\Sales\Model\Order::class); |
27 |
| - $order->loadByIncrementId('100000001'); |
28 |
| - |
29 |
| - $this->assertEquals('Example', $order->getStatusLabel()); |
| 17 | + return [ |
| 18 | + 'backend label' => [ |
| 19 | + 'adminhtml', |
| 20 | + 'Example', |
| 21 | + ], |
| 22 | + 'store view label' => [ |
| 23 | + 'frontend', |
| 24 | + 'Store view example', |
| 25 | + ], |
| 26 | + ]; |
30 | 27 | }
|
31 | 28 |
|
32 | 29 | /**
|
33 |
| - * In the frontend the store view specific label must be showed. |
| 30 | + * In the backend the regular label must be showed. |
| 31 | + * |
| 32 | + * @param $area |
| 33 | + * @param $result |
34 | 34 | *
|
35 | 35 | * @magentoDataFixture Magento/Sales/_files/order_status.php
|
| 36 | + * @dataProvider theCorrectLabelIsUsedDependingOnTheAreaProvider |
36 | 37 | */
|
37 |
| - public function testTheStoreViewLabelIsUsedInTheFrontend() |
| 38 | + public function testTheCorrectLabelIsUsedDependingOnTheArea($area, $result) |
38 | 39 | {
|
39 | 40 | $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
|
40 |
| - $objectManager->get(\Magento\Framework\App\State::class)->setAreaCode('frontend'); |
| 41 | + $objectManager->get(\Magento\Framework\App\State::class)->setAreaCode('adminhtml'); |
41 | 42 |
|
42 | 43 | /** @var \Magento\Sales\Model\Order $order */
|
43 | 44 | $order = $objectManager->create(\Magento\Sales\Model\Order::class);
|
44 | 45 | $order->loadByIncrementId('100000001');
|
45 | 46 |
|
46 |
| - $this->assertEquals('Store view example', $order->getStatusLabel()); |
| 47 | + $this->assertEquals('Example', $order->getStatusLabel()); |
47 | 48 | }
|
48 | 49 | }
|
0 commit comments