diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ff64489..2d118b8 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -60,6 +60,7 @@ public function boot(): void }); \Livewire\Livewire::component('app.filament.pages.price-list-processor', \App\Filament\Pages\PriceListProcessor::class); + \Livewire\Livewire::component('app.filament.auth.login', \App\Filament\Auth\Login::class); \Livewire\Livewire::component('app.filament.pages.calendar-test', \App\Filament\Pages\CalendarTest::class); \Livewire\Livewire::component('app.filament.widgets.delivery-calendar-widget', \App\Filament\Widgets\DeliveryCalendarWidget::class); /* diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index 56a24db..dd626cf 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -32,7 +32,7 @@ public function panel(Panel $panel): Panel ->homeUrl('/') ->brandName('') ->brandLogo(null) - ->login() + ->login(\App\Filament\Auth\Login::class) ->colors([ 'primary' => '#b83400', 'gray' => [ diff --git a/app/Providers/Filament/SupplierPanelProvider.php b/app/Providers/Filament/SupplierPanelProvider.php index 5e8e448..b8a0982 100644 --- a/app/Providers/Filament/SupplierPanelProvider.php +++ b/app/Providers/Filament/SupplierPanelProvider.php @@ -23,7 +23,7 @@ public function panel(Panel $panel): Panel return $panel ->id('supplierPortal') ->path('supplier-portal') - ->login() + ->login(\App\Filament\Auth\Login::class) ->brandName(fn () => auth()->check() && auth()->user()->supplier ? 'Beszállítói Portál – ' . auth()->user()->supplier->name : 'Beszállítói Portál') diff --git a/phpunit.xml b/phpunit.xml index 461fb27..8ec1686 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -23,8 +23,8 @@ - - + + diff --git a/tests/TestCase.php b/tests/TestCase.php index 89b2649..e807985 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -8,12 +8,29 @@ abstract class TestCase extends BaseTestCase { protected function setUp(): void { - parent::setUp(); + if (! $this->app) { + $this->refreshApplication(); + } + + // Kényszerítsük a teszt adatbázist, ha valamiért nem az lenne (pl. cache-elt config) + // Használjuk az env() függvényt, mert a config() a cache miatt csalhat + if (env('APP_ENV') === 'testing') { + config(['database.connections.mysql.database' => 'd2dTest']); + } $currentDb = config('database.connections.mysql.database'); + $currentEnv = env('APP_ENV'); - if (strtolower($currentDb) !== strtolower('d2dTest') && env('APP_ENV') === 'testing') { - throw new \Exception('KRITIKUS HIBA: A tesztek NEM a d2dTest adatbázison futnak! Aktuális adatbázis: ' . $currentDb); + // Szigorú ellenőrzés a d2d (élő/helyi) adatbázis ellen + if (strtolower($currentDb) === 'd2d' && $currentEnv === 'testing') { + throw new \Exception('STOP!!! KRITIKUS HIBA: A tesztek az ÉLŐ (d2d) adatbázison akarnak futni! A folyamat leállítva a RefreshDatabase lefutása előtt. Kérlek futtasd a "php artisan config:clear" parancsot!'); } + + // Általános ellenőrzés, hogy a teszt adatbázis legyen használva + if (strtolower($currentDb) !== 'd2dtest' && $currentEnv === 'testing') { + throw new \Exception('HIBA: A teszteknek a d2dTest adatbázison kellene futniuk. Aktuális konfiguráció: ' . $currentDb . '. Kérlek futtasd a "php artisan config:clear" parancsot!'); + } + + parent::setUp(); } }