diff --git a/tests/Validator/ConfigurationValidatorTest.php b/tests/Validator/ConfigurationValidatorTest.php index 4885b84..ca34691 100644 --- a/tests/Validator/ConfigurationValidatorTest.php +++ b/tests/Validator/ConfigurationValidatorTest.php @@ -21,3 +21,20 @@ test('The project name should be a string', function (mixed $projectName, int $e yield 'True' => [true, 1]; yield 'False' => [false, 2]; }); + +test('The project language should be a supported language', function (mixed $language, int $expectedViolationCount) { + $configuration = [ + 'language' => $language, + ]; + + expect($this->validator->validate($configuration)) + ->toHaveCount($expectedViolationCount); +})->with(function () { + yield 'Supported language string' => ['php', 0]; + yield 'Non-supported language string' => ['not-supported', 1]; + yield 'Empty string' => ['', 1]; + yield 'Integer' => [1, 2]; + yield 'Null' => [null, 1]; + yield 'True' => [true, 2]; + yield 'False' => [false, 2]; +});