You are here

public function SearchSetLocaleTest::testSearchWithNumericLocale in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/search/tests/src/Functional/SearchSetLocaleTest.php \Drupal\Tests\search\Functional\SearchSetLocaleTest::testSearchWithNumericLocale()
  2. 9 core/modules/search/tests/src/Functional/SearchSetLocaleTest.php \Drupal\Tests\search\Functional\SearchSetLocaleTest::testSearchWithNumericLocale()

Verify that search works with a numeric locale set.

File

core/modules/search/tests/src/Functional/SearchSetLocaleTest.php, line 47

Class

SearchSetLocaleTest
Tests that search works with numeric locale settings.

Namespace

Drupal\Tests\search\Functional

Code

public function testSearchWithNumericLocale() {

  // French decimal point is comma.
  setlocale(LC_NUMERIC, 'fr_FR');
  $this->nodeSearchPlugin
    ->setSearch('tapir', [], []);

  // The call to execute will throw an exception if a float in the wrong
  // format is passed in the query to the database, so an assertion is not
  // necessary here.
  $this->nodeSearchPlugin
    ->execute();
}