/** * @test * @return void */ public function registrationActionAssignsEventToView() { $event = new \DERHANSEN\SfEventMgt\Domain\Model\Event(); $view = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\View\\ViewInterface'); $view->expects($this->once())->method('assign')->with('event', $event); $this->inject($this->subject, 'view', $view); $this->subject->registrationAction($event); }
/** * @test * @return void */ public function registrationActionAssignsEventToView() { $event = new \DERHANSEN\SfEventMgt\Domain\Model\Event(); $mockPaymentService = $this->getMock('DERHANSEN\\SfEventMgt\\Service\\PaymentService', ['getPaymentMethods'], [], '', false); $mockPaymentService->expects($this->once())->method('getPaymentMethods')->will($this->returnValue(['invoice'])); $this->inject($this->subject, 'paymentService', $mockPaymentService); $view = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\View\\ViewInterface'); $view->expects($this->at(0))->method('assign')->with('event', $event); $view->expects($this->at(1))->method('assign')->with('paymentMethods', ['invoice']); $this->inject($this->subject, 'view', $view); $this->subject->registrationAction($event); }