createSystemAuthFixture([
'title' => '命中权限',
'code' => 'match-role',
'remark' => '命中说明',
'status' => 1,
'create_time' => '2026-03-10 08:00:00',
]);
$this->createSystemAuthFixture([
'title' => '跨日权限',
'code' => 'cross-day-role',
'remark' => '跨日说明',
'status' => 1,
'create_time' => '2026-03-09 08:00:00',
]);
$this->createSystemAuthFixture([
'title' => '禁用权限',
'code' => 'disabled-role',
'remark' => '禁用说明',
'status' => 0,
'create_time' => '2026-03-10 09:00:00',
]);
$result = $this->callIndexController([
'output' => 'json',
'type' => 'index',
'title' => '命中',
'create_time' => '2026-03-10 - 2026-03-10',
'plugin_group' => 'common',
'_field_' => 'id',
'_order_' => 'asc',
'page' => 1,
'limit' => 20,
]);
$this->assertSame(200, intval($result['code'] ?? 0));
$this->assertSame('JSON-DATA', $result['info'] ?? '');
$this->assertSame(1, intval($result['data']['page']['total'] ?? 0));
$this->assertCount(1, $result['data']['list'] ?? []);
$this->assertSame('命中权限', $result['data']['list'][0]['title'] ?? '');
$this->assertSame('common', $result['data']['list'][0]['plugin_group'] ?? '');
}
public function testIndexGetRendersPageBuilderMarkup(): void
{
$html = $this->callActionHtml('index', ['plugin_group' => 'tester']);
$this->assertStringContainsString('page-builder-schema', $html);
$this->assertStringContainsString('id="RoleTable"', $html);
$this->assertStringContainsString('StatusSwitchRoleTable', $html);
$this->assertStringContainsString('data-open=', $html);
$this->assertStringNotContainsString('