[ 'sid' => $envVars['WANGDIAN_TEST_SID'], 'app_key' => $envVars['WANGDIAN_TEST_APP_KEY'], 'app_secret' => $envVars['WANGDIAN_TEST_APP_SECRET'], ], 'endpoints' => [ 'sandbox_base_url' => $envVars['WANGDIAN_TEST_BASE_URL'] ?? 'https://sandbox.wangdian.cn/openapi2', ], 'settings' => [ 'timeout' => (int)($envVars['WANGDIAN_TEST_TIMEOUT'] ?? 30), 'debug' => ($envVars['WANGDIAN_TEST_DEBUG'] ?? 'true') === 'true', 'log_file' => null, ], 'test_mode' => [ 'use_real_credentials' => true, 'run_integration_tests' => ($envVars['RUN_INTEGRATION_TESTS'] ?? 'false') === 'true', 'run_real_api_tests' => ($envVars['RUN_REAL_API_TESTS'] ?? 'false') === 'true', ], ]; } } } // Fallback to mock configuration if real credentials not available if (!$useRealCredentials) { self::$config = [ 'credentials' => [ 'sid' => 'test_sid_12345', 'app_key' => 'test_app_key_67890', 'app_secret' => 'test_app_secret_abcdef', ], 'endpoints' => [ 'sandbox_base_url' => 'https://mock-api.example.com/openapi2', ], 'settings' => [ 'timeout' => 5, 'debug' => true, 'log_file' => null, ], 'test_mode' => [ 'use_real_credentials' => false, 'run_integration_tests' => false, 'run_real_api_tests' => false, ], ]; } return self::$config; } /** * Check if using real credentials */ public static function isUsingRealCredentials(): bool { $config = self::get(); return $config['test_mode']['use_real_credentials']; } /** * Check if integration tests should run */ public static function shouldRunIntegrationTests(): bool { $config = self::get(); return $config['test_mode']['run_integration_tests']; } /** * Check if real API tests should run */ public static function shouldRunRealApiTests(): bool { $config = self::get(); return $config['test_mode']['run_real_api_tests']; } /** * Get mock response data */ public static function getMockResponses(): array { return [ 'success' => [ 'code' => 0, 'message' => 'Success', 'data' => ['test' => 'result'] ], 'error' => [ 'code' => 1001, 'message' => 'Test error', 'data' => null ], ]; } }