function OrderByTest::testInvalidDirection
Checks that invalid sort directions in ORDER BY get converted to ASC.
File
- 
              core/tests/ Drupal/ Tests/ Core/ Database/ OrderByTest.php, line 35 
Class
- OrderByTest
- Tests the orderBy() method of select queries.
Namespace
Drupal\Tests\Core\DatabaseCode
public function testInvalidDirection() {
  $this->query
    ->orderBy('test', 'invalid direction');
  $order_bys = $this->query
    ->getOrderBy();
  $this->assertEquals($order_bys['test'], 'ASC', 'Invalid order by direction is converted to ASC.');
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
