mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-04 19:17:46 +09:00
* Slight structure change to the testcases * Fix * Ported some random low-level tests * Spelling * Ported over some other low-level tests * Fixes * And now other fixes * Another one
33 lines
967 B
PHP
33 lines
967 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace HookTests;
|
|
|
|
use APIHelper\Request;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class AdminTest extends TestCase
|
|
{
|
|
public function testBatchConnect(): void
|
|
{
|
|
$result = Request::makeRequest('admin/hook/batch_connect');
|
|
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
|
|
$this->assertTrue($result->getResult());
|
|
}
|
|
|
|
public function testGetHookList(): void
|
|
{
|
|
$result = Request::makeRequest('admin/hook/get_list');
|
|
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
|
|
$this->assertIsArray($result->getResult());
|
|
$this->assertNotEmpty($result->getResult());
|
|
}
|
|
|
|
public function testHookCall(): void
|
|
{
|
|
$result = Request::makeRequest('admin/hook/call', ['event' => 'onBeforeAdminCronRun']);
|
|
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
|
|
}
|
|
}
|