feat: decouple Laravel and CakePHP installers, remove SonarQube artifacts, and enforce complete unit testing standards
- Decouple framework installation: add install-laravel.sh and install-cakephp.sh, isolate skills and docs per framework, and auto-clean leftover artifacts - Remove all SonarQube configs, templates, and references - Enforce comprehensive test completeness: 100% public methods, edge cases, full branch coverage, exception paths, and state assertions - Replace all placeholder assertions in PHPUnit and Pest templates with full realistic implementations - Rename and update 10-comprehensive-test-coverage-guide.md
This commit is contained in:
@@ -14,7 +14,8 @@ describe('{{ClassName}}', function () {
|
||||
it('passes validation with valid payload', function () {
|
||||
$request = new {{ClassName}}();
|
||||
$validator = Validator::make([
|
||||
// Valid data here
|
||||
'name' => 'John Doe',
|
||||
'email' => 'john@example.com',
|
||||
], $request->rules());
|
||||
|
||||
expect($validator->fails())->toBeFalse();
|
||||
@@ -26,4 +27,15 @@ describe('{{ClassName}}', function () {
|
||||
|
||||
expect($validator->fails())->toBeTrue();
|
||||
});
|
||||
|
||||
it('fails validation for invalid fields', function ($payload, $expectedErrorField) {
|
||||
$request = new {{ClassName}}();
|
||||
$validator = Validator::make($payload, $request->rules());
|
||||
|
||||
expect($validator->fails())->toBeTrue();
|
||||
expect($validator->errors()->has($expectedErrorField))->toBeTrue();
|
||||
})->with([
|
||||
'invalid email' => [['name' => 'John Doe', 'email' => 'invalid-email'], 'email'],
|
||||
'empty name' => [['name' => '', 'email' => 'john@example.com'], 'name'],
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user