Beispiel #1
0
 /**
  * A basic functional test example.
  *
  * @return void
  */
 public function test_get_outlets()
 {
     $repo = new OutletRepository(new Outlet());
     $outlets = $repo->getPaginatedForOwner($this->owner());
     $token = $this->getTokenAsOwner();
     $data = $this->createPaginated($outlets, new OutletTransformer());
     $this->get('v1/outlets', $token);
     $this->assertResponseStatus(200);
     $this->seeJson($data->toArray());
 }
Beispiel #2
0
 public function test_get_stockout_from_specific_outlet()
 {
     $repo = new OutletRepository(new Outlet());
     $outlet = Outlet::all()->random();
     $owner = $this->owner();
     $stocks = $repo->getStockOutsPaginated($outlet->id, $owner);
     $data = $this->createPaginated($stocks, new StockOutTransformer());
     $token = $this->getTokenAsOwner();
     $this->get('v1/outlets/' . $this->encode($outlet->id) . '/stock-outs', $token);
     $this->assertResponseStatus(200);
     $result = $data->toArray();
     //pop the meta array
     array_pop($result);
     $this->seeJson($result);
 }