Ejemplo n.º 1
0
 public function setUp()
 {
     $this->channel = $this->getMock('Oro\\Bundle\\IntegrationBundle\\Entity\\Channel');
     $this->customer = $this->getMock('OroCRM\\Bundle\\MagentoBundle\\Entity\\Customer');
     $this->contact = $this->getMock('OroCRM\\Bundle\\ContactBundle\\Entity\\Contact');
     $this->address = $this->getMock('OroCRM\\Bundle\\MagentoBundle\\Entity\\Address');
     $this->contactAddress = $this->getMock('OroCRM\\Bundle\\ContactBundle\\Entity\\ContactAddress');
     $this->contactPhone = $this->getMock('OroCRM\\Bundle\\ContactBundle\\Entity\\ContactPhone');
     $this->country = $this->getMockBuilder('Oro\\Bundle\\AddressBundle\\Entity\\Country')->disableOriginalConstructor()->getMock();
     $this->region = $this->getMockBuilder('Oro\\Bundle\\AddressBundle\\Entity\\Region')->disableOriginalConstructor()->getMock();
     $collection = $this->getMock('Doctrine\\Common\\Collections\\Collection');
     $collection->expects($this->any())->method('getValues')->will($this->returnValue([$this->address]));
     $this->country->expects($this->any())->method('getIso2Code')->will($this->returnValue('US'));
     $this->region->expects($this->any())->method('getCombinedCode')->will($this->returnValue('US-US'));
     $this->contactAddress->expects($this->any())->method('getCountry')->will($this->returnValue($this->country));
     $this->contactAddress->expects($this->any())->method('getRegion')->will($this->returnValue($this->region));
     $this->customer->expects($this->any())->method('getContact')->will($this->returnValue($this->contact));
     $this->customer->expects($this->any())->method('getChannel')->will($this->returnValue($this->channel));
     $this->address->expects($this->any())->method('getContactAddress')->will($this->returnValue($this->contactAddress));
     $this->address->expects($this->any())->method('getContactPhone')->will($this->returnValue($this->contactPhone));
     $this->address->expects($this->any())->method('getCountry')->will($this->returnValue($this->country));
     $this->address->expects($this->any())->method('getRegion')->will($this->returnValue($this->region));
     $this->customer->expects($this->any())->method('getAddresses')->will($this->returnValue($collection));
 }