Files
FOSSBilling/tests-legacy/modules/Cron/Api/AdminTest.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

33 lines
767 B
PHP

<?php
declare(strict_types=1);
namespace Box\Mod\Cron\Api;
use PHPUnit\Framework\Attributes\Group;
#[Group('Core')]
final class AdminTest extends \BBTestCase
{
public function testGetDi(): void
{
$di = $this->getDi();
$api_admin = new Admin();
$api_admin->setDi($di);
$getDi = $api_admin->getDi();
$this->assertEquals($di, $getDi);
}
public function testInfo(): void
{
$serviceMock = $this->createMock(\Box\Mod\Cron\Service::class);
$serviceMock->expects($this->atLeastOnce())->method('getCronInfo')->willReturn([]);
$api_admin = new Admin();
$api_admin->setService($serviceMock);
$result = $api_admin->info([]);
$this->assertIsArray($result);
}
}