feat(timezone): implement Tehran timezone handling across the application

This commit is contained in:
hamed
2026-07-16 00:25:21 +03:30
parent 8cd1253b81
commit 2f060bd5be
10 changed files with 90 additions and 17 deletions
+25
View File
@@ -0,0 +1,25 @@
<?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));
}
}