示例#1
0
 /**
  * @test
  * @return void
  */
 public function setEnablePaymentSetsEnablePaymentForBoolean()
 {
     $this->subject->setEnablePayment(true);
     $this->assertTrue($this->subject->getEnablePayment());
 }
 /**
  * @test
  * @return void
  */
 public function redirectPaymentEnabledReturnsTrueIfPaymentRedirectEnabled()
 {
     $event = new Event();
     $event->setEnablePayment(true);
     $mockRegistration = $this->getMock('DERHANSEN\\SfEventMgt\\Domain\\Model\\Registration', ['getEvent', 'getPaymentMethod'], [], '', false);
     $mockRegistration->expects($this->once())->method('getEvent')->will($this->returnValue($event));
     $mockRegistration->expects($this->once())->method('getPaymentMethod');
     // Payment mock object with redirect enabled
     $mockInvoice = $this->getMock('DERHANSEN\\SfEventMgt\\Payment\\Invoice', ['isRedirectEnabled'], [], '', false);
     $mockInvoice->expects($this->once())->method('isRedirectEnabled')->will($this->returnValue(true));
     $mockPaymentService = $this->getMock('DERHANSEN\\SfEventMgt\\Domain\\Service\\PaymentService', ['getPaymentInstance'], [], '', false);
     $mockPaymentService->expects($this->once())->method('getPaymentInstance')->will($this->returnValue($mockInvoice));
     $this->inject($this->subject, 'paymentService', $mockPaymentService);
     $this->assertTrue($this->subject->redirectPaymentEnabled($mockRegistration));
 }