mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-03 21:54:07 +09:00
* Rename tests to tests-legacy * Groundwork for live tests * Somewhat working tests on a live instance * Hmmmmmm * Fix * Fixed the other bug * Added a handful of various tests * Typos, all these are admin endpoints * Bypass this check for testing envs * Disable it for now * Mini cleanup * Cleanup from debugging, ran PHP-CS-Fixer
31 lines
816 B
PHP
31 lines
816 B
PHP
<?php
|
|
|
|
namespace Box\Mod\Currency\Controller;
|
|
|
|
class AdminTest extends \BBTestCase
|
|
{
|
|
public function testDi()
|
|
{
|
|
$controller = new Admin();
|
|
|
|
$di = new \Pimple\Container();
|
|
$db = $this->getMockBuilder('Box_Database')->getMock();
|
|
|
|
$di['db'] = $db;
|
|
$controller->setDi($di);
|
|
$result = $controller->getDi();
|
|
$this->assertEquals($di, $result);
|
|
}
|
|
|
|
public function testregister()
|
|
{
|
|
$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);
|
|
}
|
|
}
|