Skip to content

Commit c5b0cda

Browse files
committed
ACP2E-2738: fix static and unit tests errors
1 parent a6e1426 commit c5b0cda

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

app/code/Magento/Fedex/Test/Unit/Model/CarrierTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ public function testGetTrackingErrorResponse(): void
650650
*/
651651
public function getTrackResponse($shipTimeStamp, $expectedDate, $expectedTime): array
652652
{
653+
$expectedDateTime = ($expectedDate ? date('Y-m-d', strtotime($expectedDate)) : null).'T'.$expectedTime;
653654
$trackResponse = '{"transactionId":"4d37cd0c-f4e8-449f-ac95-d4d3132f0572",
654655
"output":{"completeTrackResults":[{"trackingNumber":"122816215025810","trackResults":[{"trackingNumberInfo":
655656
{"trackingNumber":"122816215025810","trackingNumberUniqueId":"12013~122816215025810~FDEG","carrierCode":"FDXG"},
@@ -661,14 +662,14 @@ public function getTrackResponse($shipTimeStamp, $expectedDate, $expectedTime):
661662
"latestStatusDetail":{"code":"DL","derivedCode":"DL","statusByLocale":"Delivered","description":"Delivered",
662663
"scanLocation":{"city":"Norton","stateOrProvinceCode":"VA","countryCode":"US","residential":false,
663664
"countryName":"United States"}},"dateAndTimes":[{"type":"ACTUAL_DELIVERY","dateTime":
664-
"'.$expectedDate.'T'.$expectedTime.'"},{"type":"ACTUAL_PICKUP","dateTime":"2016-08-01T00:00:00-06:00"},
665+
"'.$expectedDateTime.'"},{"type":"ACTUAL_PICKUP","dateTime":"2016-08-01T00:00:00-06:00"},
665666
{"type":"SHIP","dateTime":"'.$shipTimeStamp.'"}],"availableImages":[{"type":"SIGNATURE_PROOF_OF_DELIVERY"}],
666667
"specialHandlings":[{"type":"DIRECT_SIGNATURE_REQUIRED","description":"Direct Signature Required",
667668
"paymentType":"OTHER"}],"packageDetails":{"packagingDescription":{"type":"YOUR_PACKAGING","description":
668669
"Package"},"physicalPackagingType":"PACKAGE","sequenceNumber":"1","count":"1","weightAndDimensions":
669670
{"weight":[{"value":"21.5","unit":"LB"},{"value":"9.75","unit":"KG"}],"dimensions":[{"length":22,"width":17,
670671
"height":10,"units":"IN"},{"length":55,"width":43,"height":25,"units":"CM"}]},"packageContent":[]},
671-
"shipmentDetails":{"possessionStatus":true},"scanEvents":[{"date":"'.$expectedDate.'T'.$expectedTime.'",
672+
"shipmentDetails":{"possessionStatus":true},"scanEvents":[{"date":"'.$expectedDateTime.'",
672673
"eventType":"DL","eventDescription":"Delivered","exceptionCode":"","exceptionDescription":"","scanLocation":
673674
{"streetLines":[""],"city":"Norton","stateOrProvinceCode":"VA","postalCode":"24273","countryCode":"US",
674675
"residential":false,"countryName":"United States"},"locationType":"DELIVERY_LOCATION","derivedStatusCode":"DL",
@@ -951,27 +952,27 @@ public function shipDateDataProvider(): array
951952
'tracking1' => [
952953
'tracking1',
953954
'shipTimestamp' => '2020-08-15T02:06:35+03:00',
954-
'expectedDate' => '2014-01-09',
955+
'expectedDate' => '2014-01-09 18:31:00',
955956
'18:31:00',
956957
0,
957958
],
958959
'tracking1-again' => [
959960
'tracking1',
960961
'shipTimestamp' => '2014-01-09T02:06:35+03:00',
961-
'expectedDate' => '2014-01-09',
962+
'expectedDate' => '2014-01-09 18:31:00',
962963
'18:31:00',
963964
0,
964965
],
965966
'tracking2' => [
966967
'tracking2',
967968
'shipTimestamp' => '2014-01-09T02:06:35+03:00',
968-
'expectedDate' => '2014-01-09',
969+
'expectedDate' => '2014-01-09 23:06:35',
969970
'23:06:35',
970971
],
971972
'tracking3' => [
972973
'tracking3',
973974
'shipTimestamp' => '2014-01-09T14:06:35',
974-
'expectedDate' => '2014-01-09',
975+
'expectedDate' => '2014-01-09 18:31:00',
975976
'18:31:00',
976977
],
977978
'tracking4' => [

app/code/Magento/Shipping/view/frontend/templates/tracking/progress.phtml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,42 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/** @var $block \Magento\Framework\View\Element\Template */
7+
/**
8+
* @var \Magento\Framework\View\Element\Template $block
9+
* @var \Magento\Framework\Escaper $escaper
10+
*/
811
$parentBlock = $block->getParentBlock();
912
$track = $block->getData('track');
1013
?>
1114
<div class="table-wrapper">
12-
<table class="data table order tracking" id="track-history-table-<?= $block->escapeHtml($track->getTracking()) ?>">
13-
<caption class="table-caption"><?= $block->escapeHtml(__('Track history')) ?></caption>
15+
<table class="data table order tracking" id="track-history-table-<?= $escaper->escapeHtml($track->getTracking()) ?>">
16+
<caption class="table-caption"><?= $escaper->escapeHtml(__('Track history')) ?></caption>
1417
<thead>
1518
<tr>
16-
<th class="col location" scope="col"><?= $block->escapeHtml(__('Location')) ?></th>
17-
<th class="col date" scope="col"><?= $block->escapeHtml(__('Date')) ?></th>
18-
<th class="col time" scope="col"><?= $block->escapeHtml(__('Local Time')) ?></th>
19-
<th class="col description" scope="col"><?= $block->escapeHtml(__('Description')) ?></th>
19+
<th class="col location" scope="col"><?= $escaper->escapeHtml(__('Location')) ?></th>
20+
<th class="col date" scope="col"><?= $escaper->escapeHtml(__('Date')) ?></th>
21+
<th class="col time" scope="col"><?= $escaper->escapeHtml(__('Local Time')) ?></th>
22+
<th class="col description" scope="col"><?= $escaper->escapeHtml(__('Description')) ?></th>
2023
</tr>
2124
</thead>
2225
<tbody>
2326
<?php foreach ($track->getProgressdetail() as $detail) : ?>
24-
<?php $detailDate = (!empty($detail['deliverydate']) ?
27+
<?php $detailDate = (!empty($detail['deliverydate'])?
2528
$parentBlock->formatDeliveryDate($detail['deliverydate']) :
2629
''); ?>
2730
<?php $detailTime = (!empty($detail['deliverytime']) ?
2831
$parentBlock->formatDeliveryTime($detail['deliverytime'], $detail['deliverydate']) :
2932
''); ?>
3033
<tr>
31-
<td data-th="<?= $block->escapeHtml(__('Location')) ?>" class="col location">
32-
<?= (!empty($detail['deliverylocation']) ? $block->escapeHtml($detail['deliverylocation']) : '') ?>
34+
<td data-th="<?= $escaper->escapeHtml(__('Location')) ?>" class="col location">
35+
<?= (!empty($detail['deliverylocation']) ? $escaper->escapeHtml($detail['deliverylocation']) : '') ?>
3336
</td>
34-
<td data-th="<?= $block->escapeHtml(__('Date')) ?>" class="col date">
37+
<td data-th="<?= $escaper->escapeHtml(__('Date')) ?>" class="col date">
3538
<?= /* @noEscape */ $detailDate ?>
3639
</td>
37-
<td data-th="<?= $block->escapeHtml(__('Local Time')) ?>" class="col time">
40+
<td data-th="<?= $escaper->escapeHtml(__('Local Time')) ?>" class="col time">
3841
<?= /* @noEscape */ $detailTime ?></td>
39-
<td data-th="<?= $block->escapeHtml(__('Description')) ?>" class="col description">
42+
<td data-th="<?= $escaper->escapeHtml(__('Description')) ?>" class="col description">
4043
<?= (!empty($detail['activity']) ? $block->escapeHtml($detail['activity']) : '') ?>
4144
</td>
4245
</tr>

0 commit comments

Comments
 (0)