Skip to content

Commit 7d639ec

Browse files
committed
MC-40702: Order currency is used instead of bas currency in the shipping label for form
1 parent 8c6dd03 commit 7d639ec

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

dev/tests/integration/testsuite/Magento/Shipping/Block/Adminhtml/Order/AddToPackageTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ public function testGetCommentsHtml(): void
7777
*/
7878
public function testGetCurrencyCodeCustomValue ()
7979
{
80-
$expectedCurrencyCode = '<span class="customs-value-currency">
81-
FR </span>';
82-
$this->assertStringContainsString($expectedCurrencyCode, $this->getHtml());
80+
$template = '/<span class="customs-value-currency">\s*?(?<currency>[A-Za-z]+)\s*?<\/span>/';
81+
$matches = [];
82+
preg_match($template, $this->getHtml(), $matches);
83+
$currency = $matches['currency'] ?? null;
84+
$this->assertEquals('FR',$currency );
8385
}
8486

8587
/**

dev/tests/integration/testsuite/Magento/Shipping/_files/shipping_with_carrier_data_different_currency_code.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/** @var Transaction $transaction */
2121
$transaction = $objectManager->get(Transaction::class);
2222
/** @var ProductRepositoryInterface $productRepository */
23-
$productRepository = $objectManager->create(ProductRepositoryInterface::class);
23+
$productRepository = $objectManager->get(ProductRepositoryInterface::class);
2424
$product = $productRepository->get('simple');
2525
/** @var Order $order */
2626
$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000001');
@@ -42,7 +42,7 @@
4242
$tracking = [
4343
'carrier_code' => 'ups',
4444
'title' => 'United Parcel Service',
45-
'number' => '987654321'
45+
'number' => '987654321',
4646
];
4747

4848
$shipment = $objectManager->get(ShipmentFactory::class)->create($order, $shipmentItems, [$tracking]);

0 commit comments

Comments
 (0)