Skip to content

Commit 39ada81

Browse files
committed
test: add tests for escapeIdentifiers()
1 parent 8e1ef75 commit 39ada81

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

‎tests/system/Database/BaseConnectionTest.php‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,4 +283,27 @@ public static function provideProtectIdentifiers(): iterable
283283
],
284284
];
285285
}
286+
287+
/**
288+
* These tests are intended to confirm the current behavior.
289+
*
290+
* @dataProvider provideEscapeIdentifiers
291+
*/
292+
public function testEscapeIdentifiers(string $item, string $expected): void
293+
{
294+
$db = new MockConnection($this->options);
295+
296+
$return = $db->escapeIdentifiers($item);
297+
298+
$this->assertSame($expected, $return);
299+
}
300+
301+
public static function provideEscapeIdentifiers(): iterable
302+
{
303+
yield from [
304+
// $item, $expected
305+
'simple' => ['test', '"test"'],
306+
'with dots' => ['com.sitedb.web', '"com"."sitedb"."web"'],
307+
];
308+
}
286309
}

0 commit comments

Comments
 (0)