mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
d370423825
All sapphire but the lang directory
18 lines
648 B
PHP
18 lines
648 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());
|
|
}
|
|
}
|
|
|