You are here

public function SmartlingTestBase::setUp in TMGMT Translator Smartling 8.2

Overrides DrupalWebTestCase::setUp()

Overrides TMGMTTestBase::setUp

1 call to SmartlingTestBase::setUp()
LoggingTest::setUp in src/Tests/LoggingTest.php
Overrides DrupalWebTestCase::setUp()
1 method overrides SmartlingTestBase::setUp()
LoggingTest::setUp in src/Tests/LoggingTest.php
Overrides DrupalWebTestCase::setUp()

File

src/Tests/SmartlingTestBase.php, line 73

Class

SmartlingTestBase
Basic tests for the Smartling translator.

Namespace

Drupal\tmgmt_smartling\Tests

Code

public function setUp() {
  parent::setUp();
  $settings_file_path = __DIR__ . '/../../' . self::SETTINGS_FILE_NAME;

  // Include settings from external file.
  if (file_exists($settings_file_path) && empty($this->smartlingPluginProviderSettings)) {
    require_once $settings_file_path;

    // Fetch needed data.
    $this->smartlingPluginProviderSettings = $settings;
    $test_node = Node::load($this->testNodeId);
    $this->testNodeTitle = $test_node
      ->get('title')->value;
    $this->testNodeBody = trim(strip_tags($test_node
      ->get('body')->value));
  }

  // Additional permission: access to "Recent log messages" page and
  // access for manual context sending.
  $this
    ->loginAsAdmin([
    'access site reports',
    'send context smartling',
  ]);
}