diff --git a/tests/Database/Functional/Driver/Common/Query/SelectQueryTest.php b/tests/Database/Functional/Driver/Common/Query/SelectQueryTest.php index 90f69101..72f12f1f 100644 --- a/tests/Database/Functional/Driver/Common/Query/SelectQueryTest.php +++ b/tests/Database/Functional/Driver/Common/Query/SelectQueryTest.php @@ -2267,4 +2267,21 @@ public function testFragmentInWhereInClause(): void $select ); } + + /** + * Issue https://github.com/cycle/database/issues/49 + */ + public function testLeftJoinQuoting(): void + { + $select = $this->database + ->select() + ->from(['users']) + ->leftJoin('_1SCONST _1SCONST2(NOLOCK)') + ->on('SC3271.ID', '=', '_1SCONST2.OBJID'); + + $this->assertSameQuery( + 'SELECT * FROM {users} LEFT JOIN {_1SCONST} _1SCONST2([NOLOCK]) ON {SC3271}.{ID} = {_1SCONST2}.{OBJID}', + $select + ); + } }