1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-05 22:27:24 +02:00

Tests: Fix MySQL PDO

This commit is contained in:
Jakub Vrana
2025-03-31 11:23:19 +02:00
parent e6c0c8ab6b
commit 2504ea23c4

View File

@@ -12,7 +12,9 @@ foreach (glob("*.html") as $filename) {
}, $file);
$file = str_replace("<tr><td>open</td><td>/coverage.php?coverage=0</td><td></td></tr>\n", "", $file);
$file = str_replace("<tr><td>click</td><td>link=Explain</td><td></td></tr>\n<tr><td>verifyTextPresent</td><td>Clustered Index Scan</td><td></td></tr>\n", "", $file); // MS SQL PDO doesn't support EXPLAIN
$file = preg_replace("~//input\[@value='Login']~", "\\0</td><td></td></tr>\n<tr><td>verifyTextPresent</td><td>PDO_", $file, 1);
preg_match_all("~//input\[@value='Login']~", $file, $matches, PREG_OFFSET_CAPTURE);
list($val, $offset) = $matches[0][count($matches[0]) > 1 ? 1 : 0]; // MySQL log-ins three times, we check the second one
$file = substr_replace($file, "</td><td></td></tr>\n<tr><td>verifyTextPresent</td><td>PDO_", $offset + strlen($val), 0);
file_put_contents("pdo-$filename", $file);
}
}