示例#1
0
 /**
  * Test process method with shipping_address
  */
 public function testProcessShippingAddress()
 {
     $this->orderMock->expects($this->exactly(2))->method('getAddresses')->willReturn([$this->addressMock]);
     $this->addressMock->expects($this->once())->method('save')->will($this->returnSelf());
     $this->orderMock->expects($this->once())->method('getBillingAddress')->will($this->returnValue(null));
     $this->orderMock->expects($this->once())->method('getShippingAddress')->will($this->returnValue($this->addressMock));
     $this->addressMock->expects($this->exactly(2))->method('getId')->will($this->returnValue(2));
     $this->orderMock->expects($this->once())->method('setShippingAddressId')->will($this->returnSelf());
     $this->attributeMock->expects($this->once())->method('saveAttribute')->with($this->orderMock, ['shipping_address_id'])->will($this->returnSelf());
     $this->assertEquals($this->address, $this->address->process($this->orderMock));
 }