Error message

  • Warning: count(): Parameter must be an array or an object that implements Countable in _api_make_match_member_link() (line 1230 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Warning: count(): Parameter must be an array or an object that implements Countable in _api_make_match_member_link() (line 1230 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).

public function TMGMTDemoTest::setUp

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(),
  ]);
}