Fix phpunit mock data

This commit is contained in:
crazywhalecc
2026-04-30 11:22:19 +08:00
parent 93a227bc6d
commit a9e1327a80

View File

@@ -12,6 +12,15 @@ use SPC\exception\SPCInternalException;
function f_exec(string $command, mixed &$output, mixed &$result_code): bool function f_exec(string $command, mixed &$output, mixed &$result_code): bool
{ {
$result_code = 0; $result_code = 0;
if (str_contains($command, 'https://api.github.com/repos/AOMediaCodec/libavif/releases/latest')) {
$output = explode("\n", json_encode([
'tag_name' => 'v1.1.1',
'tarball_url' => 'https://api.github.com/repos/AOMediaCodec/libavif/tarball/v1.1.1',
'prerelease' => false,
'draft' => false,
]));
return true;
}
if (str_contains($command, 'https://api.github.com/repos/AOMediaCodec/libavif/releases')) { if (str_contains($command, 'https://api.github.com/repos/AOMediaCodec/libavif/releases')) {
$output = explode("\n", gzdecode(file_get_contents(__DIR__ . '/../assets/github_api_AOMediaCodec_libavif_releases.json.gz'))); $output = explode("\n", gzdecode(file_get_contents(__DIR__ . '/../assets/github_api_AOMediaCodec_libavif_releases.json.gz')));
return true; return true;