mirror of
https://github.com/filamentphp/filament.git
synced 2026-11-04 05:22:36 +08:00
27 lines
658 B
PHP
27 lines
658 B
PHP
<?php
|
|
|
|
use Filament\Forms\ComponentContainer;
|
|
use Filament\Forms\Components\Component;
|
|
use Illuminate\Support\Str;
|
|
use Tests\TestCase;
|
|
use Tests\Unit\Forms\Fixtures\Livewire;
|
|
|
|
uses(TestCase::class);
|
|
|
|
test('registered event listeners are executed', function () {
|
|
$event = Str::random();
|
|
|
|
$this->expectExceptionMessage($event);
|
|
|
|
ComponentContainer::make(Livewire::make())
|
|
->components([
|
|
(new Component())
|
|
->registerListeners([
|
|
$event => [
|
|
fn () => throw new Exception($event),
|
|
],
|
|
]),
|
|
])
|
|
->dispatchEvent($event);
|
|
});
|