Advertisement
Guest User

Untitled

a guest
Feb 9th, 2018
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.18 KB | None | 0 0
  1. public function testIndex()
  2.     {
  3.         Auth::login(User::where('email', 'superadmin@email.com')->first());
  4.         $response = $this->get(route('daily_bonuses.index'));
  5.         $response->assertStatus(200);
  6.     }
  7.  
  8.     public function testUpdate()
  9.     {
  10.         Auth::login(User::where('email', 'superadmin@email.com')->first());
  11.         $faker = Faker::create();
  12.  
  13.         $response = $this->put(route('daily_bonuses.update', DailyBonus::all()->random()), [
  14.             'points' => doubleval($faker->randomDigit),
  15.         ]);
  16.         $response->assertStatus(200);
  17.     }
  18.  
  19.     public function testStore()
  20.     {
  21.         Auth::login(User::where('email', 'superadmin@email.com')->first());
  22.         $faker = Faker::create();
  23.         $type = DailyBonus::$types[0];
  24.  
  25.         if (is_null(DailyBonus::where('type', $type)->first())) {
  26.             $response = $this->post(route('daily_bonuses.store'), [
  27.                 'currency_id' => Currency::where('app_currency', true)->random()->currency_id,
  28.                 'type' => DailyBonus::$types[0],
  29.                 'points' => doubleval($faker->randomDigit),
  30.             ]);
  31.             $response->assertStatus(200);
  32.         }
  33.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement