function SearchSetLocaleTest::testSearchWithNumericLocale

Same name in other branches
  1. 7.x modules/search/search.test \SearchSetLocaleTest::testSearchWithNumericLocale()
  2. 9 core/modules/search/tests/src/Functional/SearchSetLocaleTest.php \Drupal\Tests\search\Functional\SearchSetLocaleTest::testSearchWithNumericLocale()
  3. 10 core/modules/search/tests/src/Kernel/SearchSetLocaleTest.php \Drupal\Tests\search\Kernel\SearchSetLocaleTest::testSearchWithNumericLocale()
  4. 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

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();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.