1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-20 05:11:25 +02:00

Tests: Run also in PDO

This commit is contained in:
Jakub Vrana
2025-03-22 07:22:06 +01:00
parent 01a6af8b70
commit ab44927442
4 changed files with 18 additions and 2 deletions

16
tests/generate-pdo.php Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env php
<?php
// Katalon Recorder has global variables: https://docs.katalon.com/katalon-platform/plugins-and-add-ons/katalon-recorder-extension/get-your-job-done/automate-scenarios/global-variables-in-katalon-recorder
// It's possible to use them in URL in Katalon Studio but apparently not in Recorder: https://forum.katalon.com/t/45673/2
foreach (glob("*.html") as $filename) {
if (!preg_match('~^pdo-~', $filename)) {
$file = file_get_contents($filename);
$file = preg_replace_callback('~/(adminer(/sqlite)?|editor/example)\.php(\??)~', function ($match) {
return "/$match[1].php?ext=pdo" . ($match[3] ? "&amp;" : "");
}, $file);
$file = str_replace("<tr><td>open</td><td>/coverage.php?coverage=0</td><td></td></tr>\n", "", $file);
$file = preg_replace("~//input\[@value='Login']~", "\\0</td><td></td></tr>\n<tr><td>verifyTextPresent</td><td>PDO_", $file, 1);
file_put_contents("pdo-$filename", $file);
}
}