diff --git a/tests/rules/data/syntax-error-in-query-method.php b/tests/rules/data/syntax-error-in-query-method.php index 89a5a27f5..6f29ab1ab 100644 --- a/tests/rules/data/syntax-error-in-query-method.php +++ b/tests/rules/data/syntax-error-in-query-method.php @@ -149,4 +149,12 @@ public function bug458(PDO $pdo) $pdo->query('SELECT * FROM ' . $table . ' LIMIT 1'); } + public function writes(PDO $pdo, int $adaid): void + { + $pdo->query('UPDATE `ada` SET email="test" WHERE adaid = '.$adaid); + $pdo->query('INSERT INTO `ada` SET email="test" WHERE adaid = '.$adaid); + $pdo->query('REPLACE INTO `ada` SET email="test" WHERE adaid = '.$adaid); + $pdo->query('DELETE FROM `ada` WHERE adaid = '.$adaid); + } + } diff --git a/tests/rules/data/unresolvable-query-in-method.php b/tests/rules/data/unresolvable-query-in-method.php index e596a82ab..6c1f8e180 100644 --- a/tests/rules/data/unresolvable-query-in-method.php +++ b/tests/rules/data/unresolvable-query-in-method.php @@ -38,4 +38,12 @@ public function stringQueryFragment(PDO $pdo, string $string) { $pdo->query('SELECT email FROM ada WHERE '.$string); } + + public function writes(PDO $pdo, int $adaid): void + { + $pdo->query('UPDATE `ada` SET email="test" WHERE adaid = '.$adaid); + $pdo->query('INSERT INTO `ada` SET email="test" WHERE adaid = '.$adaid); + $pdo->query('REPLACE INTO `ada` SET email="test" WHERE adaid = '.$adaid); + $pdo->query('DELETE FROM `ada` WHERE adaid = '.$adaid); + } }