--- original standalone test +++ isolated fixture variant @@ -123,6 +123,22 @@ $app = new \think\App(); $app->setEnvName(TP_ENV === 'prod' && BUSINESS !== 'aizhct' ? TP_ENV . BUSINESS : TP_ENV); $app->initialize(); + +// Test-only isolated metadata fixture. Original assertions are unchanged. +$upgradeFixtureFile = tempnam(sys_get_temp_dir(), 'upgrade-wechat-'); +\think\facade\Config::set([ + 'default' => 'upgrade_fixture', + 'connections' => [ + 'upgrade_fixture' => [ + 'type' => 'sqlite', 'database' => $upgradeFixtureFile, + 'prefix' => 'yoshop_', 'deploy' => 0, + 'break_reconnect' => false, 'trigger_sql' => false, + ], + ], +], 'database'); +\think\facade\Db::connect()->execute('CREATE TABLE yoshop_recharge_order (order_id INTEGER PRIMARY KEY, pay_price DECIMAL(10,2), create_time INTEGER, update_time INTEGER)'); +register_shutdown_function(function () use ($upgradeFixtureFile) { @unlink($upgradeFixtureFile); }); + $logConfig = \think\facade\Config::get('log'); $logConfig['channels']['file']['path'] = '/tmp/ai_api_logs/'; \think\facade\Config::set($logConfig, 'log');