function SearchSetLocaleTest::testSearchWithNumericLocale
Same name in other branches
- 9 core/modules/search/tests/src/Functional/SearchSetLocaleTest.php \Drupal\Tests\search\Functional\SearchSetLocaleTest::testSearchWithNumericLocale()
- 8.9.x core/modules/search/tests/src/Functional/SearchSetLocaleTest.php \Drupal\Tests\search\Functional\SearchSetLocaleTest::testSearchWithNumericLocale()
- 10 core/modules/search/tests/src/Kernel/SearchSetLocaleTest.php \Drupal\Tests\search\Kernel\SearchSetLocaleTest::testSearchWithNumericLocale()
- 11.x core/modules/search/tests/src/Kernel/SearchSetLocaleTest.php \Drupal\Tests\search\Kernel\SearchSetLocaleTest::testSearchWithNumericLocale()
Verify that search works with a numeric locale set.
File
-
modules/
search/ search.test, line 2168
Class
- SearchSetLocaleTest
- Tests searching with locale values set.
Code
public function testSearchWithNumericLocale() {
// French decimal point is comma.
setlocale(LC_NUMERIC, 'fr_FR');
// An exception will be thrown if a float in the wrong format occurs in the
// query to the database, so an assertion is not necessary here.
db_select('search_index', 'i')->extend('searchquery')
->searchexpression('tapir', 'node')
->execute();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.