Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-34657 tests: amend tests to verify lower() is used

  • Loading branch information...
commit 5e6f26bdbeb4693a8315ebee06fb68615486ea4d 1 parent b5d155a
@stronk7 stronk7 authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/tests/datalib_test.php
View
12 lib/tests/datalib_test.php
@@ -63,8 +63,8 @@ public function test_users_order_by_sql_search_no_extra_fields() {
list($sort, $params) = users_order_by_sql('', 'search', context_system::instance());
$this->assert_same_sql('CASE WHEN
' . $DB->sql_fullname() . ' = :usersortexact1 OR
- firstname = :usersortexact2 OR
- lastname = :usersortexact3
+ LOWER(firstname) = LOWER(:usersortexact2) OR
+ LOWER(lastname) = LOWER(:usersortexact3)
THEN 0 ELSE 1 END, lastname, firstname, id', $sort);
$this->assertEquals(array('usersortexact1' => 'search', 'usersortexact2' => 'search',
'usersortexact3' => 'search'), $params);
@@ -79,10 +79,10 @@ public function test_users_order_by_sql_search_with_extra_fields_and_prefix() {
list($sort, $params) = users_order_by_sql('u', 'search', context_system::instance());
$this->assert_same_sql('CASE WHEN
' . $DB->sql_fullname('u.firstname', 'u.lastname') . ' = :usersortexact1 OR
- u.firstname = :usersortexact2 OR
- u.lastname = :usersortexact3 OR
- u.email = :usersortexact4 OR
- u.idnumber = :usersortexact5
+ LOWER(u.firstname) = LOWER(:usersortexact2) OR
+ LOWER(u.lastname) = LOWER(:usersortexact3) OR
+ LOWER(u.email) = LOWER(:usersortexact4) OR
+ LOWER(u.idnumber) = LOWER(:usersortexact5)
THEN 0 ELSE 1 END, u.lastname, u.firstname, u.id', $sort);
$this->assertEquals(array('usersortexact1' => 'search', 'usersortexact2' => 'search',
'usersortexact3' => 'search', 'usersortexact4' => 'search', 'usersortexact5' => 'search'), $params);
Please sign in to comment.
Something went wrong with that request. Please try again.