Skip to content

Commit e38feb4

Browse files
butonicOcramius
authored andcommitted
add testReturnsGetListTableColumnsSQL test
1 parent 42a5067 commit e38feb4

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,60 @@ public function testQuotedTableNames()
706706
$this->assertEquals($createTriggerStatement, $sql[3]);
707707
}
708708

709+
/**
710+
* @dataProvider getReturnsGetListTableColumnsSQL
711+
* @group DBAL-831
712+
*/
713+
public function testReturnsGetListTableColumnsSQL($database, $expectedSql)
714+
{
715+
$this->assertEquals($expectedSql, $this->_platform->getListTableColumnsSQL('"test"', $database));
716+
}
717+
718+
public function getReturnsGetListTableColumnsSQL()
719+
{
720+
return array(
721+
array(
722+
null,
723+
"SELECT c.*,
724+
(
725+
SELECT d.comments
726+
FROM user_col_comments d
727+
WHERE d.TABLE_NAME = c.TABLE_NAME
728+
AND d.COLUMN_NAME = c.COLUMN_NAME
729+
) AS comments
730+
FROM user_tab_columns c
731+
WHERE c.table_name = 'test'
732+
ORDER BY c.column_name"
733+
),
734+
array(
735+
'/',
736+
"SELECT c.*,
737+
(
738+
SELECT d.comments
739+
FROM user_col_comments d
740+
WHERE d.TABLE_NAME = c.TABLE_NAME
741+
AND d.COLUMN_NAME = c.COLUMN_NAME
742+
) AS comments
743+
FROM user_tab_columns c
744+
WHERE c.table_name = 'test'
745+
ORDER BY c.column_name"
746+
),
747+
array(
748+
'scott',
749+
"SELECT c.*,
750+
(
751+
SELECT d.comments
752+
FROM all_col_comments d
753+
WHERE d.TABLE_NAME = c.TABLE_NAME
754+
AND d.COLUMN_NAME = c.COLUMN_NAME
755+
) AS comments
756+
FROM all_tab_columns c
757+
WHERE c.table_name = 'test' AND c.owner = 'SCOTT'
758+
ORDER BY c.column_name"
759+
),
760+
);
761+
}
762+
709763
/**
710764
* {@inheritdoc}
711765
*/

0 commit comments

Comments
 (0)