$request = $request->withHeader('x-pim-is', 'awesome'); $fiftyCents = Money::EUR(50); $oneEuro = $fiftyCents->multiply(Amount::fromFloat(2.0)); https://twitter.com/Pelshoff/status/1266012117230071808 for many more examples!
$clock; public function __construct(/**/) {/**/} public function getCurrentMeetings(): array { $range = new ClosedDateTimeRange($this->clock->now(), $this->clock->now('+1 month')); return array_map( fn (Meeting $meeting) => $meeting->view(), $this->repository->findMeetingsBySpecification( new IsPublishedDuring($range) ) ); } } No input! Context Context Context
testThatRegistrationsAreUpdatedAndSaved() function testThatXyAndZAndSaved() many // Integration/DB function testThatTheAggregateCanBeSaved() function testThatSpecialCircumstancesAlsoIntegrateWell() // Unit function testThatBusinessLogicWorksAsExpected() function testThatTheyDontRequireManyMocks() function testThatIfEvenAnyAtAll() function testThatItMakesYouHappierAndMoreProductive()
+/- + - Infra complexity + +/- + Unit testing - + + Consistency Eventual Transactional It depends Conclusion For simple cases (most) For transactional boundaries For complex cases
in the solution of a problem but is in the final analysis unjustified, incapable of justification, and potentially fallible. -Billy Vaughn Koen https://www.dddheuristics.com/