getType()); self::assertSame('1', $setting->toStorageValue()); $restored = Setting::fromStorage([ 'setting_key' => 'site.enabled', 'setting_value' => '1', 'value_type' => 'bool', ]); self::assertTrue($restored->getValue()); } public function testRejectsEmptyKey(): void { $this->expectException(\InvalidArgumentException::class); new Setting('', 'value'); } public function testRejectsUnsupportedStoredType(): void { $this->expectException(\LogicException::class); $this->expectExceptionMessage('Type de paramètre stocké non supporté'); Setting::fromStorage([ 'setting_key' => 'site.mode', 'setting_value' => 'legacy', 'value_type' => 'legacy-type', ]); } }