Skip to content

Commit c707ada

Browse files
committed
Copilot continues to test
1 parent 89b92e3 commit c707ada

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

tests/core/core_url_test.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,24 @@
66
*/
77
require_once dirname(__FILE__) . '/../../../../includes/functions.php';
88

9+
// Dummy append_sid for test context
910
if (!function_exists('append_sid')) {
10-
function append_sid($url, $params = '', $is_amp = true, $session_id = false) {
11-
// For testing, just return the url and params concatenated
11+
function append_sid($url, $file = '', $params = '', $is_amp = true, $session_id = false) {
12+
// Combine all non-empty parts into a query string
13+
$query = [];
14+
if ($file !== '') {
15+
$query[] = $file;
16+
}
1217
if ($params !== '') {
13-
return $url . '?' . $params;
18+
$query[] = $params;
1419
}
15-
return $url;
20+
$qs = implode('&', $query);
21+
return $url . ($qs ? '?' . $qs : '');
1622
}
1723
}
18-
if (!function_exists('redirect')) {
24+
25+
// Dummy redirect in the test namespace
26+
if (!function_exists(__NAMESPACE__ . '\redirect')) {
1927
function redirect($url) {
2028
throw new \Exception('redirect called: ' . $url);
2129
}

0 commit comments

Comments
 (0)