mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-04 06:04:16 +09:00
* 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>
32 lines
742 B
PHP
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']);
|
|
}
|
|
}
|