Files
FOSSBilling/tests/Modules/Theme/AdminTest.php
T
Yağızhan Burak YakarandAdam Daley 091bd5c67b Refactor guest API routes and reduce the information passed (#3474)
* Remove guest API system version endpoint

* Moved theme information to Admin API

* Removed references to the old "comment" module

* Remove unused cron endpoints

* Don't pass registrar information to guests

* Filter out Product toApiArray properties

* Redact public ticket information passed via the guest API

* Move redaction logic to the serializer

* Moved honeypot information to a Twig function

* More redaction

* Fixed tests

* Block additional paths

* Reduce the amount of information passed to clients

* Mask file downloads behind sendFile rather than serializing original path

* Move honeypot information to the new Twig function

* Add missing curly bracket

* Removed unused `get_slider` endpoint

* Turn publicMessageToApiArray into an allowlist

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2026-05-04 21:48:11 +01:00

34 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace ThemeTests;
use APIHelper\Request;
use PHPUnit\Framework\TestCase;
final class AdminTest extends TestCase
{
public function testGetCurrentClientTheme(): void
{
$result = Request::makeRequest('admin/theme/get_current');
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
$this->assertIsArray($result->getResult());
$this->assertArrayHasKey('name', $result->getResult());
$this->assertArrayHasKey('version', $result->getResult());
$this->assertEquals('FOSSBilling', $result->getResult()['author']);
}
public function testGetCurrentAdminTheme(): void
{
$result = Request::makeRequest('admin/theme/get_current', ['client' => false]);
$this->assertTrue($result->wasSuccessful(), $result->generatePHPUnitMessage());
$this->assertIsArray($result->getResult());
$this->assertArrayHasKey('name', $result->getResult());
$this->assertArrayHasKey('version', $result->getResult());
$this->assertEquals('FOSSBilling', $result->getResult()['author']);
}
}