MINOR: Don't run MySQL-specific tests on any other database

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79350 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-06-16 05:33:03 +00:00
parent 4df21d29e0
commit 5fb45eb846

View File

@ -69,23 +69,26 @@ class SQLQueryTest extends SapphireTest {
}
function testSelectWithLimitClause() {
// numeric limit
$query = new SQLQuery();
$query->from[] = "MyTable";
$query->limit("99");
$this->assertEquals("SELECT * FROM MyTable LIMIT 99", $query->sql());
// These are MySQL specific :-S
if(DB::getConn() instanceof MySQLDatabase) {
// numeric limit
$query = new SQLQuery();
$query->from[] = "MyTable";
$query->limit("99");
$this->assertEquals("SELECT * FROM MyTable LIMIT 99", $query->sql());
// array limit
$query = new SQLQuery();
$query->from[] = "MyTable";
$query->limit(array('limit'=>99));
$this->assertEquals("SELECT * FROM MyTable LIMIT 99", $query->sql());
// array limit
$query = new SQLQuery();
$query->from[] = "MyTable";
$query->limit(array('limit'=>99));
$this->assertEquals("SELECT * FROM MyTable LIMIT 99", $query->sql());
// array limit with start (MySQL specific)
$query = new SQLQuery();
$query->from[] = "MyTable";
$query->limit(array('limit'=>99, 'start'=>97));
$this->assertEquals("SELECT * FROM MyTable LIMIT 99 OFFSET 97", $query->sql());
// array limit with start (MySQL specific)
$query = new SQLQuery();
$query->from[] = "MyTable";
$query->limit(array('limit'=>99, 'start'=>97));
$this->assertEquals("SELECT * FROM MyTable LIMIT 99 OFFSET 97", $query->sql());
}
}
function testSelectWithOrderbyClause() {