You are here

function TMGMTUiReviewTest::setUp in Translation Management Tool 8

Overrides DrupalWebTestCase::setUp()

Overrides TMGMTTestBase::setUp

File

tests/src/Functional/TMGMTUiReviewTest.php, line 26

Class

TMGMTUiReviewTest
Verifies the UI of the review form.

Namespace

Drupal\Tests\tmgmt\Functional

Code

function setUp() : void {
  parent::setUp();
  $this
    ->addLanguage('de');
  $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();
}