/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = \Faker\Factory::create();
     TodoList::truncate();
     foreach (range(1, 50) as $index) {
         TodoList::create(['name' => $faker->sentence(2), 'description' => $faker->sentence(5), 'complete' => false]);
     }
 }
Ejemplo n.º 2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     TodoList::destroy($id);
     return redirect()->action('ListsController@index');
 }
Ejemplo n.º 3
0
 /**
  * A basic functional test example.
  *
  * @return void
  */
 public function testShouldCreateNewRandomTodoWithCompletedTask()
 {
     $todo = factory(TodoList::class)->create();
     $this->assertTrue($todo->complete);
     $this->assertTrue(count(TodoList::all()) == 1);
 }