diff --git a/tests/generate-pdo.php b/tests/generate-pdo.php index 40741142..3a4c6bd7 100755 --- a/tests/generate-pdo.php +++ b/tests/generate-pdo.php @@ -12,7 +12,9 @@ foreach (glob("*.html") as $filename) { }, $file); $file = str_replace("open/coverage.php?coverage=0\n", "", $file); $file = str_replace("clicklink=Explain\nverifyTextPresentClustered Index Scan\n", "", $file); // MS SQL PDO doesn't support EXPLAIN - $file = preg_replace("~//input\[@value='Login']~", "\\0\nverifyTextPresentPDO_", $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, "\nverifyTextPresentPDO_", $offset + strlen($val), 0); file_put_contents("pdo-$filename", $file); } }