Exemplo n.º 1
0
 public function testRemoveItem()
 {
     $cartId = 11;
     $itemId = 5;
     $this->quoteRepositoryMock->expects($this->once())->method('get')->with($cartId)->will($this->returnValue($this->quoteMock));
     $this->quoteMock->expects($this->once())->method('getItemById')->with($itemId)->will($this->returnValue($this->quoteItemMock));
     $this->quoteMock->expects($this->once())->method('removeItem');
     $this->quoteMock->expects($this->once())->method('collectTotals')->will($this->returnValue($this->quoteMock));
     $this->quoteMock->expects($this->once())->method('save')->will($this->returnValue($this->quoteMock));
     $this->assertTrue($this->service->removeItem($cartId, $itemId, $this->dataMock));
 }