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>
33 lines
767 B
PHP
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);
|
|
}
|
|
}
|