feat: xxbb

This commit is contained in:
hashbro
2026-08-14 13:15:52 +08:00
parent 3c9cda5329
commit 52fc3a4c4a
11 changed files with 213 additions and 38 deletions
+22
View File
@@ -435,4 +435,26 @@ class XxbbC2ApiTest extends TestCase
$this->assertArrayHasKey('db_sqlite', $ks->raw_json);
$this->assertSame('AQID', $ks->raw_json['datacenterAuthInfoById'] ?? null);
}
#[Test]
public function xxbb_request_logs_to_xxbb_folder_not_c2(): void
{
$marker = 'XXBBLOG'.uniqid();
$xxbbLog = public_path('log/xxbb/'.date('Ymd').'.log');
$c2Log = public_path('log/c2/'.date('Ymd').'.log');
@unlink($xxbbLog);
$this->xxbbPost('/event', [
'd' => '000C30D83CD0402E',
'et' => $marker,
])->assertOk();
$this->assertFileExists($xxbbLog);
$xxbbBody = (string) file_get_contents($xxbbLog);
$this->assertStringContainsString('/event', $xxbbBody);
$this->assertStringContainsString($marker, $xxbbBody);
if (is_file($c2Log)) {
$this->assertStringNotContainsString($marker, (string) file_get_contents($c2Log));
}
}
}