Files
kefu/im/server-fix-20260901/test_list_page_cache.php
T
2026-09-03 08:38:17 +08:00

21 lines
1.2 KiB
PHP

<?php
require __DIR__ . '/XxiawListPageCache.php';
$cases = array(
array(array('REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/app_games/index3.html', 'QUERY_STRING' => 's=Home-icp-show-dir-app_games-p-3'), 3),
array(array('REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/app_games/index2560.html', 'QUERY_STRING' => ''), 2560),
array(array('REQUEST_METHOD' => 'HEAD', 'REQUEST_URI' => '/app_games/index3.html', 'QUERY_STRING' => ''), false),
array(array('REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/app_games/index3.html?x=1', 'QUERY_STRING' => 'x=1'), false),
array(array('REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/downgame/index3.html', 'QUERY_STRING' => ''), false),
array(array('REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/app_games/index0.html', 'QUERY_STRING' => ''), false),
array(array('REQUEST_METHOD' => 'POST', 'REQUEST_URI' => '/app_games/index3.html', 'QUERY_STRING' => ''), false),
);
foreach ($cases as $index => $case) {
$actual = xxiaw_list_cache_page_number($case[0]);
if ($actual !== $case[1]) {
fwrite(STDERR, 'case ' . $index . ' failed' . PHP_EOL);
exit(1);
}
}
echo "7 list cache scope tests passed.\n";