Skip to content

Commit

Permalink
added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Feb 26, 2023
1 parent 0e209fc commit 7254665
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/rules/data/syntax-error-in-query-method.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
8 changes: 8 additions & 0 deletions tests/rules/data/unresolvable-query-in-method.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 7254665

Please sign in to comment.