Files
FOSSBilling/tests-legacy/modules/Currency/Controller/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

36 lines
894 B
PHP

<?php
declare(strict_types=1);
namespace Box\Mod\Currency\Controller;
use PHPUnit\Framework\Attributes\Group;
#[Group('Core')]
final class AdminTest extends \BBTestCase
{
public function testDi(): void
{
$controller = new Admin();
$di = $this->getDi();
$db = $this->createMock('Box_Database');
$di['db'] = $db;
$controller->setDi($di);
$result = $controller->getDi();
$this->assertEquals($di, $result);
}
public function testRegister(): void
{
$boxAppMock = $this->getMockBuilder('\Box_App')->disableOriginalConstructor()->getMock();
$boxAppMock->expects($this->once())
->method('get')
->with('/currency/manage/:code', 'get_manage', ['code' => '[a-zA-Z]+'], Admin::class);
$controllerAdmin = new Admin();
$controllerAdmin->register($boxAppMock);
}
}