mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-22 13:02:39 +09:00
44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
|
|
namespace Box\Mod\Cron\Api;
|
|
|
|
|
|
class AdminTest extends \PHPUnit_Framework_TestCase {
|
|
|
|
public function testgetDi()
|
|
{
|
|
$di = new \Box_Di();
|
|
$api_admin = new \Box\Mod\Cron\Api\Admin();
|
|
$api_admin->setDi($di);
|
|
$getDi = $api_admin->getDi();
|
|
$this->assertEquals($di, $getDi);
|
|
}
|
|
|
|
public function testinfo()
|
|
{
|
|
$serviceMock = $this->getMockBuilder('\Box\Mod\Cron\Service')->getMock();
|
|
$serviceMock->expects($this->atLeastOnce())->method('getCronInfo')->will($this->returnValue(array()));
|
|
|
|
$api_admin = new \Box\Mod\Cron\Api\Admin();
|
|
$api_admin->setService($serviceMock);
|
|
|
|
$result = $api_admin->info(array());
|
|
$this->assertInternalType('array', $result);
|
|
}
|
|
|
|
public function testrun()
|
|
{
|
|
$serviceMock = $this->getMockBuilder('\Box\Mod\Cron\Service')->getMock();
|
|
$serviceMock->expects($this->atLeastOnce())->method('runCrons')->will($this->returnValue(true));
|
|
|
|
$api_admin = new \Box\Mod\Cron\Api\Admin();
|
|
$api_admin->setService($serviceMock);
|
|
|
|
$result = $api_admin->run(array());
|
|
$this->assertInternalType('bool', $result);
|
|
}
|
|
|
|
|
|
}
|
|
|