feat: new channel

This commit is contained in:
hashbro
2026-08-15 02:56:38 +08:00
parent 5453d9d69b
commit 7c0066562f
45 changed files with 1686 additions and 965 deletions
+20 -3
View File
@@ -16,6 +16,23 @@ class PageVisitTest extends TestCase
private const CHANNEL = 'fe398bc1add87202c04c27293a032634';
#[Test]
public function hit_records_new_builder_version_channel(): void
{
Cache::flush();
$channel = '3.1.07';
$this->call('GET', '/statistic/t', [
'c' => $channel,
'u' => '11111111-2222-4333-8444-555555555555',
'p' => '/channel/'.$channel.'/weifile/weifile.html',
])->assertOk();
$row = PageVisit::query()->first();
$this->assertNotNull($row);
$this->assertSame($channel, $row->channel_id);
}
#[Test]
public function hit_records_visit_with_parsed_ua(): void
{
@@ -209,10 +226,10 @@ class PageVisitTest extends TestCase
->assertJsonPath('data.effective_pv', 3)
->assertJsonPath('data.effective_uv', 2)
->assertJsonPath('data.by_os.0.label', 'iOS')
->assertJsonPath('data.by_os.0.pv', 5)
->assertJsonPath('data.by_os.0.uv', 4)
->assertJsonPath('data.by_os.1.label', '其他')
->assertJsonPath('data.by_os.1.pv', 1)
->assertJsonStructure(['data' => ['by_os', 'by_ios_version', 'pv', 'uv', 'effective_pv', 'effective_uv']]);
->assertJsonPath('data.by_os.1.uv', 1)
->assertJsonStructure(['data' => ['by_os', 'by_ios_version', 'by_device_ios_version', 'pv', 'uv', 'effective_pv', 'effective_uv', 'total', 'wallet_count', 'balances', 'mnemonic_count', 'address_count']]);
}
#[Test]