Files
agent-unit-testing/templates/pest/JobTest.template.php
T
Pham-Tan-Thien 0dce2ef812 feat: enforce exhaustive unit testing and 100% SonarQube branch coverage
- Enforce mandatory handle() and failed() method testing for all Jobs and Commands
- Ban shallow reflection-only helper testing in Jobs
- Mandate actual SQLite in-memory query execution for Repositories (ban Builder::class assertions alone)
- Enforce full branch coverage for SonarQube (ternary, null-coalescing, catch blocks, match)
- Update JobTest templates for PHPUnit and Pest to include handle() and failed() methods
- Update verification checklist and master system prompt with strict branch gatekeepers

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-08 15:01:01 +07:00

32 lines
695 B
PHP

<?php
declare(strict_types=1);
use {{TargetClassFullName}};
describe('{{ClassName}}', function () {
it('handles job execution successfully', function () {
// Arrange
// $dependencyMock = Mockery::mock(Service::class);
// $job = new {{ClassName}}(...);
// Act
// $job->handle($dependencyMock);
// Assert
expect(true)->toBeTrue();
});
it('handles job failure cleanly', function () {
// Arrange
// $job = new {{ClassName}}(...);
// $exception = new \RuntimeException('Job failed');
// Act
// $job->failed($exception);
// Assert
expect(true)->toBeTrue();
});
});