<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Statistiky\Tests;

use Orchestra\Testbench\TestCase as OrchestraTestCase;
use Seka\Portal\Modul\Statistiky\Providers\StatistikyServiceProvider;

/**
 * Class TestCase
 *
 * @package Seka\Portal\Modul\Statistiky\Tests
 */
class TestCase extends OrchestraTestCase
{
    /**
     * You might have already used this method in your own tests. Often it is used when you need a certain model in all
     * following tests. The instantiation of that model can therefore be extracted to a setUp() method which is called
     * before each test. Within the tests, the desired model can be retrieved from the Test class instance variable.
     * When using this method, don’t forget to call the parent setUp() method (and make sure to return void).
     */
    public function setUp(): void
    {
        parent::setUp();

        $this->loadMigrationsFrom([
            '--path' => realpath(__DIR__ . '/../Database/Migrations')
        ]);
    }

    /**
     * As the name suggest, we can load our service provider(s) within the getPackageProviders() method. We’ll do that
     * by returning an array containing all providers. For now, we’ll just include the package specific package
     * provider, but imagine that if the package uses an EventServiceProvider, we would also register it here.
     *
     * @param \Illuminate\Foundation\Application $app
     *
     * @return string[]
     */
    protected function getPackageProviders($app): array
    {
        return [
            StatistikyServiceProvider::class,
        ];
    }

    /**
     * Get application timezone.
     *
     * @param  \Illuminate\Foundation\Application  $app
     * @return string|null
     */
    protected function getApplicationTimezone($app)
    {
        return 'Europe/Bratislava';
    }

    /**
     * As suggested by Orchestra Testbench: “If you need to add something early in the application bootstrapping
     * process, you could use the getEnvironmentSetUp() method”. Therefore, I suggest it is called before the setUp()
     * method(s).
     *
     * @param \Illuminate\Foundation\Application $app
     */
    protected function getEnvironmentSetUp($app): void
    {

    }
}
