shouldReceive('execute') ->once() ->andReturn(true); $job = new {{ClassName}}('sample-payload-data'); // 2. Act: BẮT BUỘC thực thi method handle() $job->handle($dependencyMock); // 3. Assert: Verify thông qua Mockery expectations và trạng thái xử lý $this->addToAssertionCount(1); } #[Test] public function it_handles_job_failure_cleanly(): void { // 1. Arrange: Chuẩn bị exception giả lập $job = new {{ClassName}}('sample-payload-data'); $exception = new \RuntimeException('Processing failed permanently'); // 2. Act: BẮT BUỘC kiểm thử method failed(Throwable $e) $job->failed($exception); // 3. Assert: Xác minh việc dọn dẹp hoặc ghi log khi job thất bại hoàn toàn $this->addToAssertionCount(1); } }