Files
lotteryLaravel/e2e/providers/E2EServiceProvider.php
kang 6ec9634704
Some checks failed
lotterLaravel CI / test (push) Has been cancelled
feat: 添加E2E测试环境配置支持
添加LOTTERY_E2E环境变量来控制E2E测试相关功能,
包括绕过验证码、登录限制和钱包API URL验证,
同时更新composer.json以包含E2E专用的提供者和服务。
2026-06-18 14:42:22 +08:00

32 lines
757 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace E2E\Providers;
use Illuminate\Support\ServiceProvider;
/**
* E2E 专用 ServiceProvider
* - 仅在 LOTTERY_E2E=true 时注册(生产环境不挂载)
* - 加载 e2e/routes/e2e.php仅 /api/v1/_e2e/* 路由)
* - 加载 e2e/app/Http/Controllers/Api/V1/E2E/* 控制器
*
* 由 composer autoload-dev 加载(命名空间 E2E\\
* 运行时由 bootstrap/app.php 检测 LOTTERY_E2E 显式 register。
*/
final class E2EServiceProvider extends ServiceProvider
{
public function register(): void
{
// no-op
}
public function boot(): void
{
if (! (bool) env('LOTTERY_E2E', false)) {
return;
}
$this->loadRoutesFrom(__DIR__.'/../routes/e2e.php');
}
}