public function testInvalidPaymentThrowsException() { $dtoBuilderFactory = new DTOBuilderFactory(); $this->setExpectedException(DTOBuilderException::class, 'Invalid payment'); $dtoBuilderFactory->getPaymentDTOBuilder(new FakePayment()); }