function TMGMTUiJavascriptTest::setUp

File

tests/src/FunctionalJavascript/TMGMTUiJavascriptTest.php, line 61

Class

TMGMTUiJavascriptTest
Verifies the UI of the review form.

Namespace

Drupal\Tests\tmgmt\FunctionalJavascript

Code

function setUp() : void {
  parent::setUp();
  $this
    ->addLanguage('de');
  $this->default_translator = Translator::load('test_translator');
  $filtered_html_format = FilterFormat::create(array(
    'format' => 'filtered_html',
    'name' => 'Filtered HTML',
  ));
  $filtered_html_format
    ->save();
  $this
    ->drupalCreateContentType(array(
    'type' => 'test_bundle',
  ));
  $this
    ->loginAsAdmin(array(
    'create translation jobs',
    'submit translation jobs',
    'create test_bundle content',
    $filtered_html_format
      ->getPermissionName(),
  ));
  \Drupal::service('file_system')
    ->copy(DRUPAL_ROOT . '/core/misc/druplicon.png', 'public://example.jpg');
  $this->image = File::create(array(
    'uri' => 'public://example.jpg',
  ));
  $this->image
    ->save();
}