Guest User

Untitled

a guest
Jul 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. use RefreshDatabase;
  2. public function sampleCreateUser()
  3. {
  4. return [
  5. ['jhune carlo', 'trogelio'],
  6. []
  7. // [['first_name' => 'jhune carlo'], 'last_name' => 'trogelio'],
  8. // ['first_name' => 'jhune', 'last_name' => 'dela trogelio'],
  9. ];
  10. }
  11.  
  12. /**
  13. * @todo Fix ErrorException: Illegal string offset 'first_name'
  14. * @dataProvider sampleCreateUser
  15. * @test
  16. */
  17. public function shouldBeAbleToCreateEmployee($first, $last)
  18. {
  19. $admin = \factory(User::class)->create();
  20. $this->actingAs($admin, 'office')->post(\route('office.employees.submit'), ['first_name' => $first,
  21. 'last_name' => $last, 'role_id' => '1', 'store_id' => '1']);
  22.  
  23. $this->assertDatabaseHas('users', ['first_name' => $first,
  24. 'last_name' => $last, 'role_id' => '1', 'store_id' => '1']);
  25. }
Add Comment
Please, Sign In to add comment