mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
4df21d29e0
commit
5fb45eb846
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user