/** * @test */ public function removeBillingAddressSetsBillingAddressToNull() { $this->subject->setBillingAddress(new BillingAddress()); $this->subject->removeBillingAddress(); $this->assertNull($this->subject->getBillingAddress()); }
/** * @param Reservation $reservation * @param BillingAddress $newBillingAddress * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException */ public function createBillingAddressAction(Reservation $reservation, BillingAddress $newBillingAddress) { $reservation->setBillingAddress($newBillingAddress); $this->personRepository->add($newBillingAddress); $this->reservationRepository->update($reservation); $this->addFlashMessage($this->translate('message.reservation.createBillingAddress.success')); $this->redirect('edit', null, null, ['reservation' => $reservation]); }