ContentTranslationUISkipTest.php

Same filename and directory in other branches
  1. 9 core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php
  2. 8.9.x core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php
  3. 10 core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php

Namespace

Drupal\Tests\content_translation\Functional

File

core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\content_translation\Functional;

use Drupal\Tests\BrowserTestBase;

/**
 * Tests the content translation UI check skip.
 *
 * @covers \Drupal\language\Form\ContentLanguageSettingsForm
 * @covers ::_content_translation_form_language_content_settings_form_alter
 * @group content_translation
 */
class ContentTranslationUISkipTest extends BrowserTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'content_translation_test',
    'user',
    'node',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  
  /**
   * Tests the content_translation_ui_skip key functionality.
   */
  public function testUICheckSkip() : void {
    $admin_user = $this->drupalCreateUser([
      'translate any entity',
      'administer content translation',
      'administer languages',
    ]);
    $this->drupalLogin($admin_user);
    // Visit the content translation.
    $this->drupalGet('admin/config/regional/content-language');
    // Check the message regarding UI integration.
    $this->assertSession()
      ->pageTextContains('Test entity - Translatable skip UI check');
    $this->assertSession()
      ->pageTextContains('Test entity - Translatable check UI (Translation is not supported)');
  }

}

Classes

Title Deprecated Summary
ContentTranslationUISkipTest Tests the content translation UI check skip.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.