Skip to content

Commit 17f50e3

Browse files
committed
ensure that the getChangeStatusAt value is provided to the formatDateTime
1 parent eda3772 commit 17f50e3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ public function testGetSubscriberStatusChangedDate($statusDate, $dateExpected)
193193
->disableOriginalConstructor()
194194
->setMethods(['loadByCustomer', 'getChangeStatusAt', 'isSubscribed', 'getData'])
195195
->getMock();
196-
$this->localeDateMock->method('formatDateTime')->willReturn($statusDate);
196+
$statusDate = new \DateTime($statusDate);
197+
$this->localeDateMock->method('formatDateTime')->with($statusDate)->willReturn($dateExpected);
197198

198199
$subscriberMock->method('loadByCustomer')->with($customerId, $websiteId)->willReturnSelf();
199200
$subscriberMock->method('getChangeStatusAt')->willReturn($statusDate);
@@ -213,7 +214,7 @@ public function getChangeStatusAtDataProvider()
213214
return
214215
[
215216
['',''],
216-
['Nov 22, 2023, 1:00:00 AM','Nov 22, 2023, 1:00:00 AM']
217+
['Nov 22, 2023, 1:00:00 AM','Nov 23, 2023, 2:00:00 AM']
217218
];
218219
}
219220

0 commit comments

Comments
 (0)