mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-27 13:06:04 +02:00
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());
|
|
}
|
|
}
|
|
|