Files
FOSSBilling/tests-legacy/library/Box/Box_EventManagerTest.php
T
Adam DaleyandCopilot a0b3158b30 PHPUnit test-legacy refactor and cleanup (#3144)
* PHPUnit test-legacy cleanup

Refactor and cleanup the legacy PHPUnit tests.

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-13 17:32:09 +00:00

32 lines
742 B
PHP

<?php
declare(strict_types=1);
#[Group('Core')]
final class Box_EventManagerTest extends BBTestCase
{
#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testEmptyFire(): void
{
$manager = new Box_EventManager();
$manager->fire([]);
}
public function testFire(): void
{
$db_mock = $this->createMock('Box_Database');
$db_mock->expects($this->atLeastOnce())
->method('getAll')
->willReturn([]);
$di = $this->getDi();
$di['logger'] = new Box_Log();
$di['db'] = $db_mock;
$manager = new Box_EventManager();
$manager->setDi($di);
$manager->fire(['event' => 'onBeforeClientSignup']);
}
}