コード例 #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement("TRUNCATE TABLE games RESTART IDENTITY CASCADE");
     $games = [['name' => 'Donkey Kong'], ['name' => 'Mario Kart']];
     foreach ($games as $game) {
         Game::create($game);
     }
 }
コード例 #2
0
 public function testGameDelete()
 {
     Game::create(['name' => $this->gameName]);
     Game::create(['name' => $this->gameNameTwo]);
     $this->json('DELETE', 'games/1');
     $this->assertResponseStatus(204);
     $this->assertEquals(1, Game::count());
 }
コード例 #3
0
 public function delete(JsonResponse $res, $id)
 {
     $this->game->destroy($id);
     return new JsonResponse(null, 204);
 }
コード例 #4
0
 public function setUp()
 {
     parent::setUp();
     $this->game = Game::create($this->gameAttrs);
     $this->gameTwo = Game::create($this->gameAttrsTwo);
 }