public function test_getCurrentStock_noCustomer_noLink() { /** === Test Data === */ $CUST_ID = 21; $STOCK_ID = 32; $LINK = new \Praxigento\Warehouse\Data\Entity\Customer(); $LINK->setStockRef($STOCK_ID); /** === Setup Mocks === */ // $custId = $this->_session->getCustomerId(); $this->mSession->shouldReceive('getCustomerId')->once()->andReturn($CUST_ID); // $link = $this->_repoCustomer->getById($custId); $this->mRepoCustomer->shouldReceive('getById')->once()->andReturn(null); // $stockId = $this->_subRepo->getStockId(); $this->mSubRepo->shouldReceive('getStockId')->once()->andReturn($STOCK_ID); // $this->_repoCustomer->create($data); $this->mRepoCustomer->shouldReceive('create')->once(); /** === Call and asserts === */ $req = new Request\GetCurrentStock(); $resp = $this->obj->getCurrentStock($req); $this->assertTrue($resp->isSucceed()); $this->assertEquals($STOCK_ID, $resp->getStockId()); }