コード例 #1
0
ファイル: plotController.php プロジェクト: bossgame1234/MS4SF
 /**
  * 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;
 }
コード例 #2
0
 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));
 }