Commit b6dd89ac authored by jibran's avatar jibran

Issue #2849669 by jibran: Fix \Drupal\Component\Utility\Unicode() because of...

Issue #2849669 by jibran: Fix \Drupal\Component\Utility\Unicode() because of the Symfony mbstring polyfill
parent d34930e1
......@@ -2,7 +2,6 @@
namespace Drupal\Tests\dynamic_entity_reference\Functional;
use Drupal\Component\Utility\Unicode;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
......@@ -71,7 +70,7 @@ class DynamicEntityReferenceFieldDefaultValueTest extends BrowserTestBase {
// Create a node to be referenced.
$referenced_node = $this->drupalCreateNode(['type' => 'referenced_content']);
$field_name = Unicode::strtolower($this->randomMachineName());
$field_name = mb_strtolower($this->randomMachineName());
$field_storage = FieldStorageConfig::create([
'field_name' => $field_name,
'entity_type' => 'node',
......
......@@ -3,7 +3,6 @@
namespace Drupal\Tests\dynamic_entity_reference\Functional;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Site\Settings;
......@@ -400,7 +399,7 @@ class DynamicEntityReferenceTest extends BrowserTestBase {
\Drupal::service('module_installer')->install(['taxonomy']);
$vocabulary = Vocabulary::create([
'name' => $this->randomMachineName(),
'vid' => Unicode::strtolower($this->randomMachineName()),
'vid' => mb_strtolower($this->randomMachineName()),
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
]);
$vocabulary->save();
......@@ -485,7 +484,7 @@ class DynamicEntityReferenceTest extends BrowserTestBase {
$vocabulary = Vocabulary::create([
'name' => $this->randomMachineName(),
'vid' => Unicode::strtolower($this->randomMachineName()),
'vid' => mb_strtolower($this->randomMachineName()),
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
]);
$vocabulary->save();
......
......@@ -2,7 +2,6 @@
namespace Drupal\Tests\dynamic_entity_reference\Functional;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\Entity\EntityFormDisplay;
use Drupal\Core\Url;
use Drupal\field\Entity\FieldConfig;
......@@ -67,7 +66,7 @@ class DynamicEntityReferenceWidgetTest extends BrowserTestBase {
// Create admin user.
$this->adminUser = $this->drupalCreateUser($this->permissions);
$field_name = Unicode::strtolower($this->randomMachineName());
$field_name = mb_strtolower($this->randomMachineName());
$field_storage = FieldStorageConfig::create([
'field_name' => $field_name,
'entity_type' => 'node',
......
......@@ -4,7 +4,6 @@ namespace Drupal\Tests\dynamic_entity_reference\FunctionalJavascript;
use Behat\Mink\Element\NodeElement;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Site\Settings;
use Drupal\Core\Url;
......@@ -95,7 +94,7 @@ class DynamicEntityReferenceTest extends JavascriptTestBase {
'description' => 'My test description',
])->save();
// We will query on the first two characters of the second username.
$autocomplete_query = Unicode::substr($this->anotherUser->label(), 0, 3);
$autocomplete_query = mb_substr($this->anotherUser->label(), 0, 3);
$this->testEntity = EntityTest::create([
// Make this partially match the second user name.
'name' => $autocomplete_query . $this->randomMachineName(5),
......
......@@ -11,7 +11,6 @@ use Drupal\entity_test\Entity\EntityTest;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\taxonomy\Entity\Term;
use Drupal\Component\Utility\Unicode;
use Drupal\taxonomy\Entity\Vocabulary;
use Drupal\Tests\field\Kernel\FieldKernelTestBase;
use Drupal\user\Entity\User;
......@@ -57,7 +56,7 @@ class DynamicEntityReferenceItemTest extends FieldKernelTestBase {
$this->vocabulary = Vocabulary::create([
'name' => $this->randomMachineName(),
'vid' => Unicode::strtolower($this->randomMachineName()),
'vid' => mb_strtolower($this->randomMachineName()),
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
]);
$this->vocabulary->save();
......@@ -314,7 +313,7 @@ class DynamicEntityReferenceItemTest extends FieldKernelTestBase {
* Tests that the 'handler' field setting stores the proper plugin ID.
*/
public function testSelectionHandlerSettings() {
$field_name = Unicode::strtolower($this->randomMachineName());
$field_name = mb_strtolower($this->randomMachineName());
$field_storage = FieldStorageConfig::create([
'field_name' => $field_name,
'entity_type' => 'entity_test',
......
......@@ -2,7 +2,6 @@
namespace Drupal\Tests\dynamic_entity_reference\Kernel;
use Drupal\Component\Utility\Unicode;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\node\Entity\NodeType;
......@@ -62,19 +61,19 @@ class DynamicEntityReferenceSettingsTest extends KernelTestBase {
$this->installEntitySchema('entity_test');
$this->nodeType = NodeType::create([
'type' => Unicode::strtolower($this->randomMachineName()),
'type' => mb_strtolower($this->randomMachineName()),
'name' => $this->randomString(),
]);
$this->nodeType->save();
$this->vocabulary = Vocabulary::create([
'vid' => Unicode::strtolower($this->randomMachineName()),
'vid' => mb_strtolower($this->randomMachineName()),
'name' => $this->randomString(),
]);
$this->vocabulary->save();
// Create a custom bundle.
$this->customBundle = 'test_bundle_' . Unicode::strtolower($this->randomMachineName());
$this->customBundle = 'test_bundle_' . mb_strtolower($this->randomMachineName());
entity_test_create_bundle($this->customBundle, NULL, 'entity_test');
}
......@@ -83,7 +82,7 @@ class DynamicEntityReferenceSettingsTest extends KernelTestBase {
*/
public function testConfigTargetBundleDeletion() {
// Attach an entity reference field to $this->nodeType.
$name = Unicode::strtolower($this->randomMachineName());
$name = mb_strtolower($this->randomMachineName());
$label = $this->randomString();
$vid = $this->vocabulary->id();
$handler_settings = ['target_bundles' => [$vid => $vid]];
......@@ -137,7 +136,7 @@ class DynamicEntityReferenceSettingsTest extends KernelTestBase {
*/
public function testCustomTargetBundleDeletion() {
// Attach an entity reference field to $this->nodeType.
$name = Unicode::strtolower($this->randomMachineName());
$name = mb_strtolower($this->randomMachineName());
$label = $this->randomString();
$handler_settings = ['target_bundles' => [$this->customBundle => $this->customBundle]];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment