namespace Drupal\Tests\config_translation\Functional;
use Drupal\block_content\Entity\BlockContentType;
-use Drupal\Component\Utility\Unicode;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\language\Entity\ConfigurableLanguage;
// tests.
$this->config('locale.settings')
->set('translation.import_enabled', TRUE)
+ ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL)
->save();
$this->drupalPlaceBlock('local_tasks_block');
}
protected function doBlockListTest() {
// Add a test block, any block will do.
// Set the machine name so the translate link can be built later.
- $id = Unicode::strtolower($this->randomMachineName(16));
+ $id = mb_strtolower($this->randomMachineName(16));
$this->drupalPlaceBlock('system_powered_by_block', ['id' => $id]);
// Get the Block listing.
// this does not test more than necessary.
$this->drupalGet('admin/structure/menu/add');
// Lowercase the machine name.
- $menu_name = Unicode::strtolower($this->randomMachineName(16));
+ $menu_name = mb_strtolower($this->randomMachineName(16));
$label = $this->randomMachineName(16);
$edit = [
'id' => $menu_name,
$vocabulary = Vocabulary::create([
'name' => $this->randomMachineName(),
'description' => $this->randomMachineName(),
- 'vid' => Unicode::strtolower($this->randomMachineName()),
+ 'vid' => mb_strtolower($this->randomMachineName()),
]);
$vocabulary->save();
// Create a test custom block type to decouple looking for translate
// operations link so this does not test more than necessary.
$block_content_type = BlockContentType::create([
- 'id' => Unicode::strtolower($this->randomMachineName(16)),
+ 'id' => mb_strtolower($this->randomMachineName(16)),
'label' => $this->randomMachineName(),
- 'revision' => FALSE
+ 'revision' => FALSE,
]);
$block_content_type->save();
// Create a test contact form to decouple looking for translate operations
// link so this does not test more than necessary.
$contact_form = ContactForm::create([
- 'id' => Unicode::strtolower($this->randomMachineName(16)),
+ 'id' => mb_strtolower($this->randomMachineName(16)),
'label' => $this->randomMachineName(),
]);
$contact_form->save();
// Create a test content type to decouple looking for translate operations
// link so this does not test more than necessary.
$content_type = $this->drupalCreateContentType([
- 'type' => Unicode::strtolower($this->randomMachineName(16)),
+ 'type' => mb_strtolower($this->randomMachineName(16)),
'name' => $this->randomMachineName(),
]);
// Create a test format to decouple looking for translate operations
// link so this does not test more than necessary.
$filter_format = FilterFormat::create([
- 'format' => Unicode::strtolower($this->randomMachineName(16)),
+ 'format' => mb_strtolower($this->randomMachineName(16)),
'name' => $this->randomMachineName(),
]);
$filter_format->save();
// Create a test shortcut to decouple looking for translate operations
// link so this does not test more than necessary.
$shortcut = ShortcutSet::create([
- 'id' => Unicode::strtolower($this->randomMachineName(16)),
+ 'id' => mb_strtolower($this->randomMachineName(16)),
'label' => $this->randomString(),
]);
$shortcut->save();
public function doUserRoleListTest() {
// Create a test role to decouple looking for translate operations
// link so this does not test more than necessary.
- $role_id = Unicode::strtolower($this->randomMachineName(16));
+ $role_id = mb_strtolower($this->randomMachineName(16));
$this->drupalCreateRole([], $role_id);
// Get the role listing.
public function doFieldListTest() {
// Create a base content type.
$content_type = $this->drupalCreateContentType([
- 'type' => Unicode::strtolower($this->randomMachineName(16)),
+ 'type' => mb_strtolower($this->randomMachineName(16)),
'name' => $this->randomMachineName(),
]);
$block_content_type = BlockContentType::create([
'id' => 'basic',
'label' => 'Basic',
- 'revision' => FALSE
+ 'revision' => FALSE,
]);
$block_content_type->save();
$field = FieldConfig::create([