gecche / laravel-multidomain

A Laravel extension for using a laravel application on a multi domain setting
MIT License
851 stars 107 forks source link

Feature/Unit Tests have no --domain option, so no .env loaded, so they can not working if needed #115

Closed MrCanan closed 7 months ago

MrCanan commented 7 months ago

Hi,

New problem/question

Environnement

Env

DB_DATABASE=__ABSOLUTE_PATH__/database/database_test.sqlite

Database

Feature/Unit Test

tests\Feature\CustomTest.php

<?php

namespace Tests\Feature;

use Tests\TestCase;

use Illuminate\Foundation\Testing\RefreshDatabase;

use App\Models\User;
use Database\Seeders\UserSeeder;

class CustomTest extends TestCase
{
    use RefreshDatabase;

    /**
     * test_get_db
     */
    public function test_get_db(): void
    {
        $oResponse = $this->get('/');

        $oResponse->assertStatus(302);
    }
}

Run

php artisan test --testsuite=Feature --stop-on-failure --filter CustomTest

Thank you in advance for any help, Best regards

gecche commented 7 months ago

Hi, I close the issue as is the same as #100. However I don't think that can be solved easily. :(

MrCanan commented 7 months ago

Hi back,

This is very annoying, because these tests are necessary

Do you have an idea? Can I help you? (to test or other)

Best regards