diff options
author | David Rothstein <drothstein@gmail.com> | 2014-11-01 13:21:52 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2014-11-01 13:21:52 -0400 |
commit | 6b7514afd2f03f3543d7c84e77cc97fa1d84dbb4 (patch) | |
tree | 5e8205a6cf1e734f8e2c30db9be64b2a598f537b /modules/simpletest | |
parent | 3a4f085dfbf48a12d364b3aa80d0ecd336eb23e9 (diff) | |
download | brdo-6b7514afd2f03f3543d7c84e77cc97fa1d84dbb4.tar.gz brdo-6b7514afd2f03f3543d7c84e77cc97fa1d84dbb4.tar.bz2 |
Issue #829464 by Berdir, klausi, sepgil | Heine: Fixed orderby() should verify that the sort direction is always ASC or DESC.
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/database_test.test | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index 209bf6813..a65cc64ec 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -1947,6 +1947,15 @@ class DatabaseSelectOrderedTestCase extends DatabaseTestCase { $this->assertEqual($num_records, 4, 'Returned the correct number of rows.'); } + + /** + * Tests that the sort direction is sanitized properly. + */ + 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.'); + } } /** |