mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
18 lines
650 B
PHP
18 lines
650 B
PHP
<?php
|
|
|
|
class DataQueryTest extends SapphireTest {
|
|
/**
|
|
* Test the leftJoin() and innerJoin method of the DataQuery object
|
|
*/
|
|
function testJoins() {
|
|
$dq = new DataQuery('Member');
|
|
$dq->innerJoin("Group_Members", "\"Group_Members\".\"MemberID\" = \"Member\".\"ID\"");
|
|
$this->assertContains("INNER JOIN \"Group_Members\" ON \"Group_Members\".\"MemberID\" = \"Member\".\"ID\"", $dq->sql());
|
|
|
|
$dq = new DataQuery('Member');
|
|
$dq->leftJoin("Group_Members", "\"Group_Members\".\"MemberID\" = \"Member\".\"ID\"");
|
|
$this->assertContains("LEFT JOIN \"Group_Members\" ON \"Group_Members\".\"MemberID\" = \"Member\".\"ID\"", $dq->sql());
|
|
}
|
|
}
|
|
|
|
?>
|