mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-09 21:43:22 +09:00
* Apply suggested fix to tests/Unit/FOSSBilling/RateLimiterTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/RateLimiterTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to src/library/Server/Manager/Directadmin.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Apply suggested fix to tests/Unit/FOSSBilling/Api/AbstractApiTest.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Remove tests path from CODEOWNERS
* Apply suggested fix to src/modules/Order/Service.php from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Fix uncancel emails and zero-credit payments
* Preserve orders when invoice generation fails
* Fix RateLimiterTest CI failures from prior autofix commits
- Add a public RateLimiter::getStatus() so tests can read the token
limit for a policy without hardcoding it (getRateLimitState() now
reuses it).
- Fix consumeOrThrow test's toThrow() call: Pest expects the assertion
closure as the first argument (with the exception type-hinted), not
as a second argument alongside the class string.
* Fix DirectAdmin apostrophe entity decoding to avoid trailing semicolon
str_replace(''', "'", $data) also matched the fully-terminated
' entity, replacing just the ' part and leaving the semicolon
behind (e.g. "O'Brien" became "O';Brien"). Replace the terminated
form first, then the legacy unterminated form, so both decode to a
plain apostrophe.
* Fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
32 lines
974 B
PHP
32 lines
974 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
function invokeDirectadminParseResponse(Server_Manager_Directadmin $manager, string $data): array
|
|
{
|
|
$reflection = new ReflectionClass($manager);
|
|
$method = $reflection->getMethod('parseResponse');
|
|
|
|
return $method->invokeArgs($manager, [$data]);
|
|
}
|
|
|
|
beforeEach(function (): void {
|
|
$this->manager = new Server_Manager_Directadmin([
|
|
'host' => 'directadmin.example.com',
|
|
'username' => 'admin',
|
|
'password' => 'secret',
|
|
]);
|
|
});
|
|
|
|
test('parseResponse decodes the fully-terminated apostrophe entity without a trailing semicolon', function (): void {
|
|
$result = invokeDirectadminParseResponse($this->manager, 'name=O'Brien');
|
|
|
|
expect($result['name'])->toBe("O'Brien");
|
|
});
|
|
|
|
test('parseResponse decodes the legacy unterminated apostrophe entity', function (): void {
|
|
$result = invokeDirectadminParseResponse($this->manager, 'name=O'Brien');
|
|
|
|
expect($result['name'])->toBe("O'Brien");
|
|
});
|