namespace Drupal\Tests\config_translation\Functional;
use Drupal\block_content\Entity\BlockContentType;
namespace Drupal\Tests\config_translation\Functional;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\language\Entity\ConfigurableLanguage;
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)
// tests.
$this->config('locale.settings')
->set('translation.import_enabled', TRUE)
protected function doBlockListTest() {
// Add a test block, any block will do.
// Set the machine name so the translate link can be built later.
protected function doBlockListTest() {
// Add a test block, any block will do.
// Set the machine name so the translate link can be built later.
$this->drupalPlaceBlock('system_powered_by_block', ['id' => $id]);
// Get the Block listing.
$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.
// this does not test more than necessary.
$this->drupalGet('admin/structure/menu/add');
// Lowercase the machine name.
$vocabulary = Vocabulary::create([
'name' => $this->randomMachineName(),
'description' => $this->randomMachineName(),
$vocabulary = Vocabulary::create([
'name' => $this->randomMachineName(),
'description' => $this->randomMachineName(),
// 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([
// 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([
// Create a test contact form to decouple looking for translate operations
// link so this does not test more than necessary.
$contact_form = ContactForm::create([
// Create a test contact form to decouple looking for translate operations
// link so this does not test more than necessary.
$contact_form = ContactForm::create([
// Create a test content type to decouple looking for translate operations
// link so this does not test more than necessary.
$content_type = $this->drupalCreateContentType([
// Create a test content type to decouple looking for translate operations
// link so this does not test more than necessary.
$content_type = $this->drupalCreateContentType([
// Create a test format to decouple looking for translate operations
// link so this does not test more than necessary.
$filter_format = FilterFormat::create([
// Create a test format to decouple looking for translate operations
// link so this does not test more than necessary.
$filter_format = FilterFormat::create([
// Create a test shortcut to decouple looking for translate operations
// link so this does not test more than necessary.
$shortcut = ShortcutSet::create([
// Create a test shortcut to decouple looking for translate operations
// link so this does not test more than necessary.
$shortcut = ShortcutSet::create([
public function doUserRoleListTest() {
// Create a test role to decouple looking for translate operations
// link so this does not test more than necessary.
public function doUserRoleListTest() {
// Create a test role to decouple looking for translate operations
// link so this does not test more than necessary.
public function doFieldListTest() {
// Create a base content type.
$content_type = $this->drupalCreateContentType([
public function doFieldListTest() {
// Create a base content type.
$content_type = $this->drupalCreateContentType([