<?php

declare(strict_types=1);

namespace Tests;

use Illuminate\Foundation\Application;
use Maestro\Core\Providers\CoreServiceProvider;
use Orchestra\Testbench\TestCase as Orchestra;
use Spatie\Permission\PermissionServiceProvider;

abstract class TestCase extends Orchestra
{
    protected $enablesPackageDiscoveries = true;

    /**
     * @param  Application  $app
     */
    protected function getPackageProviders($app): array
    {
        return [
            PermissionServiceProvider::class,
            CoreServiceProvider::class,
        ];
    }

    /**
     * @param  Application  $app
     */
    protected function defineEnvironment($app): void
    {
        $app['config']->set('app.key', 'base64:'.base64_encode(random_bytes(32)));
        $app['config']->set('auth.providers.users.model', Fixtures\AuthTestUser::class);
    }
}
