Esempio n. 1
0
 public function testDestroyPlot()
 {
     $id = \App\Plot::where('name', 'like', 'Test')->first()->id;
     $plotController = new \App\Http\Controllers\plotController();
     $plotController->destroy($id);
     $this->assertNull($plotController->show($id));
     $this->assertNull($plotController->destroy(null));
 }
Esempio n. 2
0
 public function testUpdatePlant()
 {
     $id = \App\Plot::where("name", "like", "TestActivityPlot")->first()->id;
     $plant = array('name' => 'Test plant', 'DOB' => '2015-07-28', 'harvestDay' => 50, 'type' => 'Test2', 'plot_id' => $id);
     $plantId = \App\Plant::where("name", "like", "Test plant")->first()->id;
     $plantController = new \App\Http\Controllers\plantController();
     $request = new \Illuminate\Http\Request();
     $request->replace($plant);
     $plantController->update($plantId, $request);
     $this->seeInDatabase('plant', $plant);
     $this->assertNull($plantController->update(null, $request));
 }
Esempio n. 3
0
 public function getPlots()
 {
     $plots = \App\Plot::where('account_id', $this->currentUser->agent_account_id)->get();
     return view('dashboard.plots', ['plots' => $plots]);
 }
Esempio n. 4
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $plot = Plot::where('farm_id', 'like', $id)->get();
     return $plot;
     ////
 }