This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Esun\OrderCleanup\Test\Unit\Model;
use Esun\OrderCleanup\Model\Config;
use Magento\Framework\App\Config\ScopeConfigInterface;
use PHPUnit\Framework\TestCase;
class ConfigTest extends TestCase
{
public function testReadsLifetimeFromDefaultScope(): void
{
$scopeConfig = $this->createMock(ScopeConfigInterface::class);
$scopeConfig->expects(self::once())
->method('getValue')
->with(Config::XML_PATH_CANCEL_PENDING_AFTER, ScopeConfigInterface::SCOPE_TYPE_DEFAULT)
->willReturn('45');
self::assertSame(45, (new Config($scopeConfig))->getCancellationLifetimeMinutes());
}
public function testNegativeLifetimeDisablesCancellation(): void
{
$scopeConfig = $this->createMock(ScopeConfigInterface::class);
$scopeConfig->method('getValue')->willReturn('-10');
self::assertSame(0, (new Config($scopeConfig))->getCancellationLifetimeMinutes());
}
}