. */ namespace App\Tests\Settings\BehaviorSettings; use App\Settings\BehaviorSettings\KeybindingsSettings; use App\Tests\SettingsTestHelper; use PHPUnit\Framework\TestCase; final class KeybindingsSettingsTest extends TestCase { /** * Test that the default value for enableSpecialCharacters is true */ public function testDefaultValueIsTrue(): void { $settings = SettingsTestHelper::createSettingsDummy(KeybindingsSettings::class); $this->assertTrue($settings->enableSpecialCharacters); } /** * Test that enableSpecialCharacters can be set to false */ public function testCanBeDisabled(): void { $settings = SettingsTestHelper::createSettingsDummy(KeybindingsSettings::class); $settings->enableSpecialCharacters = false; $this->assertFalse($settings->enableSpecialCharacters); } /** * Test that enableSpecialCharacters can be set to true */ public function testCanBeEnabled(): void { $settings = SettingsTestHelper::createSettingsDummy(KeybindingsSettings::class); $settings->enableSpecialCharacters = false; $settings->enableSpecialCharacters = true; $this->assertTrue($settings->enableSpecialCharacters); } /** * Test that the settings class has the correct type for enableSpecialCharacters */ public function testPropertyTypeIsBool(): void { $settings = SettingsTestHelper::createSettingsDummy(KeybindingsSettings::class); $reflection = new \ReflectionClass($settings); $property = $reflection->getProperty('enableSpecialCharacters'); $this->assertTrue($property->hasType()); $this->assertEquals('bool', $property->getType()->getName()); } }