toBeInstanceOf(NotFoundException::class) ->and($exception->getMessage())->toBe("IncoComposition for inco '12345' not found."); }); it('creates exception for generic entity', function (): void { // GIVEN $entity = 'IncoComposition'; $id = '12345'; // WHEN $exception = IncoCompositionNotFoundException::forEntity($entity, $id); // THEN expect($exception)->toBeInstanceOf(NotFoundException::class) ->and($exception->getMessage())->toBe("IncoComposition '12345' not found."); }); });