diff --git a/src/Controller/AutocompleteController.php b/src/Controller/AutocompleteController.php index 1e6e5bd1774845535a3cc27da21697dc19b2bdab..cbb4d2ea88963c3480a95832bb3edf961eadcf31 100644 --- a/src/Controller/AutocompleteController.php +++ b/src/Controller/AutocompleteController.php @@ -2,7 +2,6 @@ namespace Drupal\linkit\Controller; -use Drupal\Component\Utility\Unicode; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\linkit\SuggestionManager; @@ -77,7 +76,7 @@ class AutocompleteController implements ContainerInjectionInterface { $this->linkitProfile = $this->linkitProfileStorage->load($linkit_profile_id); $string = $request->query->get('q'); - $suggestionCollection = $this->suggestionManager->getSuggestions($this->linkitProfile, Unicode::strtolower($string)); + $suggestionCollection = $this->suggestionManager->getSuggestions($this->linkitProfile, mb_strtolower($string)); /* * If there are no suggestions from the matcher plugins, we have to add a diff --git a/src/Tests/ProfileCreationTrait.php b/src/Tests/ProfileCreationTrait.php index e662aaf1412f8dd11aa08d19368e84fdd618aa9f..2343035689e58c5a712464ed0b39fe6deffbf40a 100644 --- a/src/Tests/ProfileCreationTrait.php +++ b/src/Tests/ProfileCreationTrait.php @@ -2,7 +2,6 @@ namespace Drupal\linkit\Tests; -use Drupal\Component\Utility\Unicode; use Drupal\linkit\Entity\Profile; /** @@ -29,7 +28,7 @@ trait ProfileCreationTrait { protected function createProfile(array $settings = []) { // Populate defaults array. $settings += [ - 'id' => Unicode::strtolower($this->randomMachineName()), + 'id' => mb_strtolower($this->randomMachineName()), 'label' => $this->randomMachineName(), ]; diff --git a/tests/src/Functional/ProfileAdminTest.php b/tests/src/Functional/ProfileAdminTest.php index 3b840b9ab4447b9911aa950e3036eedb5915838f..86b40676ccdca79e82719d7e3dd4dcb549a14827 100644 --- a/tests/src/Functional/ProfileAdminTest.php +++ b/tests/src/Functional/ProfileAdminTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\linkit\Functional; -use Drupal\Component\Utility\Unicode; use Drupal\linkit\Tests\ProfileCreationTrait; /** @@ -62,8 +61,8 @@ class ProfileAdminTest extends LinkitBrowserTestBase { // Create a profile. $edit = []; - $edit['label'] = Unicode::strtolower($this->randomMachineName()); - $edit['id'] = Unicode::strtolower($this->randomMachineName()); + $edit['label'] = mb_strtolower($this->randomMachineName()); + $edit['id'] = mb_strtolower($this->randomMachineName()); $edit['description'] = $this->randomMachineName(16); $this->submitForm($edit, t('Save and manage matchers')); diff --git a/tests/src/Kernel/LinkitAutocompleteTest.php b/tests/src/Kernel/LinkitAutocompleteTest.php index 5c167b869563c5a7a8c23e34c6ebc82bfc6b6773..912d777d2a415b25cb92d597c8c77e571f00f5ed 100644 --- a/tests/src/Kernel/LinkitAutocompleteTest.php +++ b/tests/src/Kernel/LinkitAutocompleteTest.php @@ -5,7 +5,6 @@ namespace Drupal\Tests\linkit\Kernel; use Drupal\Component\Render\FormattableMarkup; use Drupal\Component\Serialization\Json; use Drupal\Component\Utility\Html; -use Drupal\Component\Utility\Unicode; use Drupal\entity_test\Entity\EntityTest; use Drupal\entity_test\Entity\EntityTestMul; use Drupal\language\Entity\ConfigurableLanguage; @@ -221,7 +220,7 @@ class LinkitAutocompleteTest extends LinkitKernelTestBase { protected function createProfile(array $settings = []) { // Populate defaults array. $settings += [ - 'id' => Unicode::strtolower($this->randomMachineName()), + 'id' => mb_strtolower($this->randomMachineName()), 'label' => $this->randomMachineName(), ]; diff --git a/tests/src/Kernel/LinkitKernelTestBase.php b/tests/src/Kernel/LinkitKernelTestBase.php index 737a0bb1f4e5972ea95d688ce919318029cc24f6..4a8bde6fde3c9223b1e1055e493bc125d127cc0a 100644 --- a/tests/src/Kernel/LinkitKernelTestBase.php +++ b/tests/src/Kernel/LinkitKernelTestBase.php @@ -51,7 +51,7 @@ abstract class LinkitKernelTestBase extends KernelTestBase { if ($permissions) { // Create a new role and apply permissions to it. $role = Role::create([ - 'id' => strtolower($this->randomMachineName(8)), + 'id' => mb_strtolower($this->randomMachineName(8)), 'label' => $this->randomMachineName(8), ]); $role->save(); diff --git a/tests/src/Kernel/Matchers/TermMatcherTest.php b/tests/src/Kernel/Matchers/TermMatcherTest.php index 22f2c446e68db8d1560413dc2619e8e6784a4332..4e04d0fde9bca5eef604cb2762c009546bbd4550 100644 --- a/tests/src/Kernel/Matchers/TermMatcherTest.php +++ b/tests/src/Kernel/Matchers/TermMatcherTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\linkit\Kernel\Matchers; -use Drupal\Component\Utility\Unicode; use Drupal\Core\Language\LanguageInterface; use Drupal\taxonomy\VocabularyInterface; use Drupal\Tests\linkit\Kernel\LinkitKernelTestBase; @@ -118,7 +117,7 @@ class TermMatcherTest extends LinkitKernelTestBase { $vocabulary = $vocabularyStorage->create([ 'name' => $name, 'description' => $name, - 'vid' => Unicode::strtolower($name), + 'vid' => mb_strtolower($name), 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, ]); $vocabulary->save();