feat: add event dispatcher destructor and implement subscriber interface with tests #23

Merged
rrise merged 2 commits from feat/more-tests into master 2025-11-30 20:28:25 +00:00
Showing only changes of commit ae96b0444c - Show all commits

View File

@@ -9,7 +9,6 @@ use Siteworxpro\Tests\Unit;
class DispatcherTest extends Unit class DispatcherTest extends Unit
{ {
/** /**
* @throws \Throwable * @throws \Throwable
* @throws BindingResolutionException * @throws BindingResolutionException
@@ -73,6 +72,9 @@ class DispatcherTest extends Unit
$this->assertTrue($eventFired, 'The FlushEvent listener was not fired.'); $this->assertTrue($eventFired, 'The FlushEvent listener was not fired.');
} }
/**
* @throws BindingResolutionException
*/
public function testHasListeners(): void public function testHasListeners(): void
{ {
$dispatcher = $this->getContainer()->make('Siteworxpro\App\Events\Dispatcher'); $dispatcher = $this->getContainer()->make('Siteworxpro\App\Events\Dispatcher');
@@ -137,6 +139,9 @@ class DispatcherTest extends Unit
unset($dispatcher); // Trigger destructor unset($dispatcher); // Trigger destructor
} }
/**
* @throws BindingResolutionException
*/
public function testToArray(): void public function testToArray(): void
{ {
$dispatcher = $this->getContainer()->make('Siteworxpro\App\Events\Dispatcher'); $dispatcher = $this->getContainer()->make('Siteworxpro\App\Events\Dispatcher');