-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathttt.php
33 lines (28 loc) · 917 Bytes
/
ttt.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
use Laravel\Socialite\Facades\Socialite;
use Illuminate\Support\Facades\Route;
class AuthTest extends TestCase
{
use RefreshDatabase;
public function test_custom_login_redirects_to_azure_auth()
{
Socialite::shouldReceive('driver->redirect')->once();
$response = $this->get('/admin/login');
$response->assertStatus(200);
}
public function test_auth_callback_route()
{
Socialite::shouldReceive('driver->stateless->user')->andReturn((object) [
'name' => 'example',
'email'=> '[email protected]',
]);
Route::any('/auth/callback', function () {
return 'auth callback';
});
$response = $this->get('/auth/callback');
$response->assertStatus(200)->assertSee('auth callback');
}
}