exec('CREATE TABLE external_links (id INTEGER PRIMARY KEY, title TEXT, style TEXT)'); $conn->exec("INSERT INTO external_links (id, title, style) VALUES (7, '', 'TAB')"); $database_sessions[$session] = $conn; $navigation = [ 'link.php:' => [ 'mapping' => '', 'title' => '', 'level' => 0, 'url' => '', ], ]; $_SERVER['SCRIPT_NAME'] = '/link.php'; $_SERVER['REQUEST_URI'] = '/link.php?id=7'; $_REQUEST = []; try { $output = draw_navigation_text(); expect($output)->toContain('<img src=x onerror=alert(1)>') ->and($output)->not->toContain('toContain("htmle(get_formatted_data_query_index(\$leaf['host_id'], intval(\$host_group_data_array[1]), \$host_group_data_array[2]))"); });