originalConfig = Config::get(ISVC_TOTAL_POSTS_KEY); isvcForget(); }); afterEach(function () { Config::set(ISVC_TOTAL_POSTS_KEY, $this->originalConfig); isvcForget(); }); test('totalLocalStatuses() returns the config_cache DB-row value unconditionally (11.4)', function () { ConfigCacheService::put(ISVC_TOTAL_POSTS_KEY, 4242); isvcForget(); expect((string) InstanceService::totalLocalStatuses())->toBe('4242'); }); test('totalLocalStatuses() falls back to the config value when no DB row exists (11.4)', function () { // Ensure there is genuinely no config_cache row (the app may have lazily // seeded one at boot), then drive the value through config() only. With no // row, the ADMINONLY read path returns the config-file fallback. ConfigCacheModel::where('k', ISVC_TOTAL_POSTS_KEY)->delete(); Config::set(ISVC_TOTAL_POSTS_KEY, 99); isvcForget(); expect((string) InstanceService::totalLocalStatuses())->toBe('99'); });