コード例 #1
0
 public function testRemoveAddress()
 {
     $id = 1;
     $this->quoteAddressCollectionMock->expects($this->once())->method('setQuoteFilter')->with($id)->will($this->returnSelf());
     $this->quoteAddressMock->expects($this->once())->method('isDeleted')->with(true);
     $this->quoteAddressMock->expects($this->once())->method('getId')->will($this->returnValue($id));
     $iterator = new \ArrayIterator([$this->quoteAddressMock]);
     $this->quoteAddressCollectionMock->expects($this->any())->method('getIterator')->will($this->returnValue($iterator));
     $this->quote->setId($id);
     $result = $this->quote->removeAddress($id);
     $this->assertInstanceOf('Magento\\Sales\\Model\\Quote', $result);
 }