Ejemplo n.º 1
0
 /**
  * @param $isDeleted
  * @param $customerAddressId
  * @param $expected
  *
  * @dataProvider dataProviderGetAddressByCustomer
  */
 public function testGetAddressByCustomerAddressId($isDeleted, $customerAddressId, $expected)
 {
     $id = 1;
     $this->quoteAddressCollectionMock->expects($this->once())->method('setQuoteFilter')->with($id)->will($this->returnSelf());
     $this->quoteAddressMock->expects($this->once())->method('isDeleted')->will($this->returnValue($isDeleted));
     $this->quoteAddressMock->expects($this->once())->method('getCustomerAddressId')->will($this->returnValue($customerAddressId));
     $iterator = new \ArrayIterator([$this->quoteAddressMock]);
     $this->quoteAddressCollectionMock->expects($this->any())->method('getIterator')->will($this->returnValue($iterator));
     $this->quote->setId($id);
     $result = $this->quote->getAddressByCustomerAddressId($id);
     $this->assertEquals((bool) $expected, (bool) $result);
 }