hoàn thành 58 test case

This commit is contained in:
2026-04-08 15:52:56 +07:00
parent c138adb108
commit 18ec75071c
13 changed files with 588 additions and 6 deletions
+17
View File
@@ -11,6 +11,23 @@ use PHPUnit\Framework\Attributes\BeforeClass;
abstract class DuskTestCase extends BaseTestCase
{
/**
* Kiểm tra xem có nên chạy Chrome ở chế độ headless không.
*
* Ưu tiên:
* 1. Nếu DUSK_HEADLESS=true (set từ shell trước khi PHP chạy) → headless
* 2. Ngược lại fallback về DUSK_HEADLESS_DISABLED trong .env
*/
protected function hasHeadlessDisabled(): bool
{
if (isset($_SERVER['DUSK_HEADLESS']) || isset($_ENV['DUSK_HEADLESS'])) {
return false; // Buộc headless dù .env có DUSK_HEADLESS_DISABLED
}
return isset($_SERVER['DUSK_HEADLESS_DISABLED']) ||
isset($_ENV['DUSK_HEADLESS_DISABLED']);
}
/**
* Prepare for Dusk test execution.
*/