Skip to content

Commit

Permalink
add test for single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbucci committed Feb 21, 2024
1 parent 0dd4213 commit b76a569
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/rewriteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,22 @@ public function test_it_handles_alter_tables_with_unique_indexes()
$this->assertSame(trim($expected), trim($postgresql));
}

public function test_it_doesnt_remove_single_quotes()
{
$sql = <<<SQL
SELECT COUNT(*) FROM wp_comments WHERE user_id = 5 AND comment_approved = '1'
SQL;

$expected = <<<SQL
SELECT COUNT(*) FROM wp_comments WHERE user_id = 5 AND comment_approved = '1'
SQL;

$postgresql = pg4wp_rewrite($sql);
$this->assertSame(trim($expected), trim($postgresql));
}




protected function setUp(): void
{
Expand Down

0 comments on commit b76a569

Please sign in to comment.