Skip to content

Commit 0d8b6b0

Browse files
#39169: Special Price To Date is wrongly validated on applySpecialPrice
- added unit tests
1 parent 131815c commit 0d8b6b0

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/TimezoneTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,42 @@ public function testScopeDate($date, string $timezone, string $locale, string $e
426426
$this->assertEquals($timezone, $scopeDate->getTimezone()->getName());
427427
}
428428

429+
/**
430+
* @return void
431+
* @throws \PHPUnit\Framework\MockObject\Exception
432+
*/
433+
public function testIsScopeDateInInterval()
434+
{
435+
$scopeMock = $this->createMock(\Magento\Framework\App\ScopeInterface::class);
436+
$this->scopeResolver->method('getScope')->willReturn($scopeMock);
437+
438+
$result = $this->getTimezone()->isScopeDateInInterval(
439+
null,
440+
'2025-04-01 00:00:00',
441+
'2999-05-01 00:00:00',
442+
);
443+
444+
$this->assertTrue($result);
445+
}
446+
447+
/**
448+
* @return void
449+
* @throws \PHPUnit\Framework\MockObject\Exception
450+
*/
451+
public function testIsScopeDateInIntervalFalse()
452+
{
453+
$scopeMock = $this->createMock(\Magento\Framework\App\ScopeInterface::class);
454+
$this->scopeResolver->method('getScope')->willReturn($scopeMock);
455+
456+
$result = $this->getTimezone()->isScopeDateInInterval(
457+
null,
458+
'2025-03-01 00:00:00',
459+
'2025-04-01 00:00:00',
460+
);
461+
462+
$this->assertFalse($result);
463+
}
464+
429465
/**
430466
* @return array
431467
*/

0 commit comments

Comments
 (0)