/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if ($id == null) { return null; } Plot::find($id)->delete(); return $id; }
public function testShowPlot() { $id = \App\Plot::where("name", "like", "test")->first()->id; $plotController = new \App\Http\Controllers\plotController(); $plot1 = $plotController->show($id); $plot2 = \App\Plot::find($id); $this->assertEquals($plot1, $plot2); $this->assertNull($plotController->show(null)); }