26 lines
788 B
PHP
26 lines
788 B
PHP
<?php
|
|
|
|
namespace App\Tests\Shared;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* تایمزون سراسری اپلیکیشن باید ایران باشد (اجباری، مستقل از php.ini سرور).
|
|
* توسط config/bootstrap_tz.php از طریق composer autoload.files تضمین میشود.
|
|
*/
|
|
class TimezoneTest extends TestCase
|
|
{
|
|
public function testDefaultTimezoneIsTehran(): void
|
|
{
|
|
$this->assertSame('Asia/Tehran', date_default_timezone_get());
|
|
}
|
|
|
|
public function testDateFunctionsUseTehran(): void
|
|
{
|
|
// یک لحظهٔ مشخص UTC → ساعت ایران (+03:30).
|
|
$ts = 1750000000; // 2025-06-15 15:06:40 UTC
|
|
$this->assertSame('+0330', date('O', $ts));
|
|
$this->assertSame('18:36', date('H:i', $ts));
|
|
}
|
|
}
|