feat: custom presets

This commit is contained in:
Nuno Maduro
2024-09-04 20:53:33 +01:00
parent a7ca7afe4e
commit dd20323ca7
12 changed files with 158 additions and 28 deletions

13
tests/Unit/Preset.php Normal file
View File

@ -0,0 +1,13 @@
<?php
pest()->presets()->custom('myFramework', function (array $userNamespaces) {
return [
expect($userNamespaces)->toBe(['Pest']),
];
});
test('preset invalid name', function () {
$this->preset()->myAnotherFramework();
})->throws(InvalidArgumentException::class, 'The preset [myAnotherFramework] does not exist. The available presets are [php, laravel, strict, security, relaxed, myFramework].');
arch()->preset()->myFramework();