Skip to content

Commit 2f527cc

Browse files
committed
Adding a few tests for DboSource::fullTableName();
1 parent a88b8dd commit 2f527cc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cake/tests/cases/libs/model/datasources/dbo_source.test.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4426,4 +4426,19 @@ function testVirtualFieldsInGroup() {
44264426
$expected = " GROUP BY (YEAR(`Article`.`created`))";
44274427
$this->assertEqual($expected, $result);
44284428
}
4429+
4430+
/**
4431+
* test the permutations of fullTableName()
4432+
*
4433+
* @return void
4434+
*/
4435+
function testFullTablePermutations() {
4436+
$Article =& ClassRegistry::init('Article');
4437+
$result = $this->testDb->fullTableName($Article, false);
4438+
$this->assertEqual($result, 'articles');
4439+
4440+
$Article->tablePrefix = 'tbl_';
4441+
$result = $this->testDb->fullTableName($Article, false);
4442+
$this->assertEqual($result, 'tbl_articles');
4443+
}
44294444
}

0 commit comments

Comments
 (0)