You are here

public function TMGMTDemoTest::setUp in Translation Management Tool 8

Overrides DrupalWebTestCase::setUp()

Overrides TMGMTTestBase::setUp

File

modules/demo/tests/src/Functional/TMGMTDemoTest.php, line 25

Class

TMGMTDemoTest
Tests the demo module for TMGMT.

Namespace

Drupal\Tests\tmgmt_demo\Functional

Code

public function setUp() : void {
  parent::setUp();
  $basic_html_format = FilterFormat::load('basic_html');
  $restricted_html_format = FilterFormat::create(array(
    'format' => 'restricted_html',
    'name' => 'Restricted HTML',
  ));
  $restricted_html_format
    ->save();
  $full_html_format = FilterFormat::create(array(
    'format' => 'full_html',
    'name' => 'Full HTML',
  ));
  $full_html_format
    ->save();
  $this
    ->loginAsAdmin([
    'access content overview',
    'administer tmgmt',
    'translate any entity',
    'edit any translatable_node content',
    $basic_html_format
      ->getPermissionName(),
    $restricted_html_format
      ->getPermissionName(),
    $full_html_format
      ->getPermissionName(),
  ]);
}