hoàn thành 58 test case
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user