25 lines
596 B
PHP
25 lines
596 B
PHP
<?php
|
|
namespace App\Domains\Auth\Tests\Services;
|
|
|
|
use App\Core\TestCase;
|
|
use App\Models\Account\Account;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class AdminAuthServiceTest extends TestCase
|
|
{
|
|
public function testAdminAuthService()
|
|
{
|
|
$adminAuthService = app('auth:admin');
|
|
|
|
$token = $adminAuthService->login('root', md5('root'), 1);
|
|
|
|
$this->assertTrue($adminAuthService->getGuard()->check());
|
|
|
|
$adminAuthService->logout();
|
|
|
|
$account = $adminAuthService->authenticate($token);
|
|
|
|
$this->assertInstanceOf(Account::class, $account);
|
|
}
|
|
}
|