test: language should be a supported language

This commit is contained in:
Oliver Davies 2023-03-11 01:11:21 +00:00
parent f25395d877
commit e223181ab7

View file

@ -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];
});