1 database_test.test | DatabaseSelectOrderedTestCase::testOrderByEscaping() |
Tests that the sort direction is sanitized properly.
File
- core/
modules/ simpletest/ tests/ database_test.test, line 1940 - Database tests.
Class
- DatabaseSelectOrderedTestCase
- Test select with order by clauses.
Code
function testOrderByEscaping() {
$query = db_select('test')->orderBy('name', 'invalid direction');
$order_bys = $query->getOrderBy();
$this->assertEqual($order_bys['name'], 'ASC', 'Invalid order by direction is converted to ASC.');
}