Example #1
0
 public function testGetBillingAddressReturnBilling()
 {
     $address = $this->getMock('JLM\\ContactBundle\\Model\\AddressInterface');
     $trustee = $this->getMock('JLM\\ModelBundle\\Entity\\Trustee');
     $trustee->expects($this->any())->method('getAddress')->will($this->returnValue($address));
     $this->entity->setTrustee($trustee);
     $billingAddress = $this->getMock('JLM\\ContactBundle\\Model\\AddressInterface');
     $city = $this->getMock('JLM\\ContactBundle\\Model\\CityInterface');
     $billingAddress->expects($this->once())->method('getCity')->will($this->returnValue($city));
     $billingAddress->expects($this->once())->method('getStreet')->will($this->returnValue('Foo'));
     $trustee->expects($this->once())->method('getBillingAddress')->will($this->returnValue($billingAddress));
     $this->assertSame($billingAddress, $this->entity->getBillingAddress());
 }