Beispiel #1
0
 public function testValidateWithValidAddress()
 {
     $addressCustomer = 100;
     $addressId = 100;
     /** Address data object */
     $addressData = $this->addressDataBuilder->setId($addressId)->setCompany('eBay Inc')->setCustomerId($addressCustomer)->create();
     /** Customer mock */
     $this->customerFactoryMock->expects($this->once())->method('create')->will($this->returnValue($this->customerMock));
     $this->customerMock->expects($this->once())->method('load')->with($addressCustomer);
     $this->customerMock->expects($this->once())->method('getId')->will($this->returnValue($addressCustomer));
     /** Quote address mock */
     $this->addressFactoryMock->expects($this->once())->method('create')->will($this->returnValue($this->quoteAddressMock));
     $this->quoteAddressMock->expects($this->once())->method('load')->with($addressId);
     $this->quoteAddressMock->expects($this->once())->method('getId')->will($this->returnValue($addressId));
     $this->quoteAddressMock->expects($this->any())->method('getCustomerId')->will($this->returnValue($addressCustomer));
     /** Validate */
     $this->model->validate($addressData);
 }