public function testReturnProduct()
 {
     $product = $this->dummyData->getProduct();
     $inventoryLocation = $this->dummyData->getInventoryLocation($this->warehouse);
     $initialTransaction = $this->dummyData->getInventoryTransaction($inventoryLocation, $product);
     $this->entityManager->persist($product);
     $this->entityManager->persist($inventoryLocation);
     $this->entityManager->persist($initialTransaction);
     $this->entityManager->flush();
     $this->inventoryService->returnProduct($product, 1, $inventoryLocation->getId());
     $transactions = $this->inventoryTransactionRepository->findAllByProduct($product);
     $transactions = $this->getDebitCreditTransactions($transactions);
     $debitTransaction = $transactions[0];
     $creditTransaction = $transactions[1];
     $this->assertSame(null, $debitTransaction->getInventoryLocation());
     $this->assertTrue($debitTransaction->getType()->isReturned());
     $this->assertSame(-1, $debitTransaction->getQuantity());
     $this->assertSame('Adjusting inventory: Returned', $debitTransaction->getMemo());
     $this->assertTrue($creditTransaction->getInventoryLocation() instanceof InventoryLocation);
     $this->assertTrue($creditTransaction->getType()->isReturned());
     $this->assertSame(1, $creditTransaction->getQuantity());
     $this->assertSame('Adjusting inventory: Returned', $creditTransaction->getMemo());
 }