Files
FOSSBilling/tests/Modules/Hook/HookAdminTest.php
T
Belle Aerni 1b0fba1922 Various additional tests (#2069)
* Various additional tests

* Fixes

* More fixes

* Fixed my other mistakes

* Final fix
2024-01-15 00:46:19 -08:00

30 lines
922 B
PHP

<?php
declare(strict_types=1);
use APIHelper\Request;
use PHPUnit\Framework\TestCase;
final class HookAdminTest extends TestCase
{
public function testBatchConnect(): void
{
$response = Request::makeRequest('admin/hook/batch_connect');
$this->assertTrue($response->wasSuccessful(), $response->generatePHPUnitMessage());
}
public function testGetHookList(): void
{
$response = Request::makeRequest('admin/hook/get_list');
$this->assertTrue($response->wasSuccessful(), $response->generatePHPUnitMessage());
$this->assertIsArray($response->getResult());
$this->assertNotEmpty($response->getResult());
}
public function testHookCall(): void
{
$response = Request::makeRequest('admin/hook/call', ['event' => 'onBeforeAdminCronRun']);
$this->assertTrue($response->wasSuccessful(), $response->generatePHPUnitMessage());
}
}