['Viande de dinde (66%)']]), portions: null, allergens: [], brand: new Brand('M01', 'Le Gaulois'), isSeasonal: true, weight: null, nutriscore: null, storageCondition: null, additives: [], compo: null, createdAt: null, updatedAt: null, ); $incoDirectory->shouldReceive('find') ->once() ->with($incoId) ->andReturn($incoSheet); // WHEN $result = $usecase->execute($input); // THEN expect($result)->toBeInstanceOf(Output::class) ->and($result->id)->toBe($incoId) ->and($result->name)->toBe('Poulet Rôti 1kg') ->and($result->label)->toBe('Poulet Rôti Classe A') ->and($result->brand->label)->toBe('Le Gaulois') ->and($result->isSeasonal)->toBeTrue(); }); it('throws NotFoundException when inco sheet does not exist', function (): void { // GIVEN $incoId = new IncoId('99999'); $input = new Input($incoId); $incoDirectory = \Mockery::mock(IncoSheetDirectory::class); $usecase = new FindIncoSheet($incoDirectory); $incoDirectory->shouldReceive('find') ->once() ->with($incoId) ->andReturnNull(); // WHEN & THEN expect(fn () => $usecase->execute($input)) ->toThrow(NotFoundException::class, "IncoSheet '99999' not found."); }); });