You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
586 B

2 years ago
  1. <?php
  2. namespace Tests\iLaravel;
  3. use App\Documents\UserDocument;
  4. use Tests\Base\FreshMongodbDatabase;
  5. use Tests\Bootstrap;
  6. class AuthTraitTest extends Bootstrap
  7. {
  8. function test_auth_provider_bind_user_via_share_database()
  9. {
  10. $user = UserDocument::factory()->create();
  11. $response = $this->getJson(
  12. route('api.ilaravels.me'),
  13. ['Authorization' => 'Bearer '. $this->getToken($user)]
  14. );
  15. $response->assertOk();
  16. $result = $response->getOriginalContent();
  17. $this->assertTrue($result->id === $user->id);
  18. }
  19. }