summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranon2018-11-10 01:21:46 (GMT)
committerEmil Stjerneman2018-11-10 01:21:46 (GMT)
commit75f9cfcb00eb4d029598beffce380603502998c0 (patch)
tree0bde5001945912bdf1bce51ee44c3c662fb2046d
parent1084887a0c4d9f0458c8d60f59ba20c342005101 (diff)
Issue #3012733 by anon: Use mb_* functions instead of Unicode::* methods
-rw-r--r--src/Controller/AutocompleteController.php3
-rw-r--r--src/Tests/ProfileCreationTrait.php3
-rw-r--r--tests/src/Functional/ProfileAdminTest.php5
-rw-r--r--tests/src/Kernel/LinkitAutocompleteTest.php3
-rw-r--r--tests/src/Kernel/LinkitKernelTestBase.php2
-rw-r--r--tests/src/Kernel/Matchers/TermMatcherTest.php3
6 files changed, 7 insertions, 12 deletions
diff --git a/src/Controller/AutocompleteController.php b/src/Controller/AutocompleteController.php
index 1e6e5bd..cbb4d2e 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 e662aaf..2343035 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 3b840b9..86b4067 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 5c167b8..912d777 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 737a0bb..4a8bde6 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 22f2c44..4e04d0f 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();