vd/app/Domains/Auth/Tests/Services/AdminAuthServiceTest.php
2018-11-05 09:26:30 +08:00

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);
}
}