Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $payment->setPaymentReminderSendStatus(true)->save();
- $this->orderPaymentMockSend->expects($this->once())
- ->method('setPaymentReminderSendStatus')
- ->with($paymentReminderSentStatus)
- ->willReturnSelf()
- ;
- $this->orderPaymentMockSend = $this->getMockBuilder(Payment::class)
- ->disableOriginalConstructor()
- ->setMethods(['setPaymentReminderSendStatus'])
- ->getMock()
- ;
- /** Mock Customer */
- //Add a magic method to the list of mocked class methods
- $methods = array_merge(
- get_class_methods(Customer::class),
- ['getCustomerType']
- );
- $this->customerModelMock = $this->getMockBuilder(Customer::class)
- ->setMethods($methods)
- ->disableOriginalConstructor()
- ->getMock();
- //Now I can mock my magic method !
- $this->customerModelMock->expects(static::any())
- ->method('getCustomerType')
- ->willReturn('professional');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement