33 lines
893 B
PHP
33 lines
893 B
PHP
<?php
|
|
|
|
namespace Tests\Unit\Services\Roles;
|
|
|
|
use App\Services\Roles\RoleDashboardService;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Tests\TestCase;
|
|
|
|
class RoleDashboardServiceTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_best_dashboard_route_for_returns_route(): void
|
|
{
|
|
DB::table('roles')->insert([
|
|
'name' => 'admin',
|
|
'slug' => 'admin',
|
|
'description' => 'Admin',
|
|
'dashboard_route' => 'administrator/administratordashboard',
|
|
'priority' => 1,
|
|
'is_active' => 1,
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
]);
|
|
|
|
$service = new RoleDashboardService;
|
|
$route = $service->bestDashboardRouteFor(['admin']);
|
|
|
|
$this->assertSame('administrator/administratordashboard', $route);
|
|
}
|
|
}
|