Files
FOSSBilling/tests/Modules/Hook/AdminTest.php
Belle Aerni 0493c3a3e5 Further test improvements (#2122)
* 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
2024-02-06 13:13:04 -08:00

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());
}
}