Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Tests\Unit;
  4.  
  5. use App\Phone;
  6. use App\User;
  7. use Illuminate\Foundation\Testing\RefreshDatabase;
  8. use Illuminate\Foundation\Testing\WithFaker;
  9. use Illuminate\Support\Facades\Schema;
  10. use Tests\TestCase;
  11.  
  12. class PhonesTest extends TestCase
  13. {
  14. use RefreshDatabase, WithFaker;
  15.  
  16. /** @test */
  17. public function a_phone_belongs_to_a_user()
  18. {
  19. $user = factory(User::class)->create();
  20. $phone = factory(Phone::class)->create(['user_id' => $user->id]);
  21.  
  22. $this->assertInstanceOf(User::class, $phone->user);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement