assertSame(trim($expected), trim($postgresql)); } public function test_it_adds_group_by() { $sql = 'SELECT COUNT(id), username FROM users'; $expected = 'SELECT COUNT(id) AS count0, username FROM users GROUP BY username'; $postgresql = pg4wp_rewrite($sql); $this->assertSame(trim($expected), trim($postgresql)); } public function test_it_handles_auto_increment() { $sql = <<assertSame(trim($expected), trim($postgresql)); } public function test_it_handles_auto_increment_without_null() { $sql = <<assertSame(trim($expected), trim($postgresql)); } public function test_it_handles_keys() { $sql = <<assertSame(trim($expected), trim($postgresql)); } public function test_it_handles_keys_without_unique() { $sql = <<assertSame(trim($expected), trim($postgresql)); } public function test_it_does_not_remove_if_not_exists() { $sql = <<assertSame(trim($expected), trim($postgresql)); } public function test_it_removes_character_sets() { $sql = <<assertSame(trim($expected), trim($postgresql)); } public function test_it_handles_multiple_keys() { $sql = <<assertSame(trim($expected), trim($postgresql)); } public function test_it_removes_table_charsets() { $sql = <<assertSame(trim($expected), trim($postgresql)); } public function test_it_can_create_keys_with_length() { $sql = <<assertSame(trim($expected), trim($postgresql)); } public function test_it_can_create_double_keys_with_length() { $sql = <<assertSame(trim($expected), trim($postgresql)); } public function test_it_can_handle_replacement_sql() { $sql = "REPLACE INTO test2 (column1, column2, column3) VALUES (1, 'Old', '2014-08-20 18:47:00')"; $expected = "INSERT INTO test2 (column1, column2, column3) VALUES (1, 'Old', '2014-08-20 18:47:00') ON CONFLICT (column1) DO UPDATE SET column2 = EXCLUDED.column2, column3 = EXCLUDED.column3"; $postgresql = pg4wp_rewrite($sql); $this->assertSame(trim($expected), trim($postgresql)); } protected function setUp(): void { global $wpdb; $wpdb = new class () { public $categories = "wp_categories"; public $comments = "wp_comments"; public $prefix = "wp_"; public $options = "wp_options"; }; } }