diff --git a/.gitignore b/.gitignore index 9940a70..3231517 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +/.phpunit.result.cache /build/ /vendor/ diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php deleted file mode 100644 index 61cd84c..0000000 --- a/tests/ExampleTest.php +++ /dev/null @@ -1,5 +0,0 @@ -toBeTrue(); -}); diff --git a/tests/Validator/ConfigurationValidatorTest.php b/tests/Validator/ConfigurationValidatorTest.php new file mode 100644 index 0000000..4885b84 --- /dev/null +++ b/tests/Validator/ConfigurationValidatorTest.php @@ -0,0 +1,23 @@ +validator = new ConfigurationValidator(); +}); + +test('The project name should be a string', function (mixed $projectName, int $expectedViolationCount) { + $configuration = [ + 'name' => $projectName, + ]; + + expect($this->validator->validate($configuration)) + ->toHaveCount($expectedViolationCount); +})->with(function () { + yield 'Non-empty string' => ['test', 0]; + yield 'Empty string' => ['', 1]; + yield 'Integer' => [1, 1]; + yield 'Null' => [null, 1]; + yield 'True' => [true, 1]; + yield 'False' => [false, 2]; +});