You are here

public function GoogleTranslatorTest::setUp in TMGMT Translator Google 8

Overrides DrupalWebTestCase::setUp()

Overrides TMGMTTestBase::setUp

File

tests/src/Functional/GoogleTranslatorTest.php, line 37

Class

GoogleTranslatorTest
Basic tests for the google translator.

Namespace

Drupal\Tests\tmgmt_google\Functional

Code

public function setUp() {
  parent::setUp();
  $this
    ->addLanguage('de');

  // Override plugin params to query tmgmt_google_test mock service instead
  // of Google Translate service.
  $url = Url::fromUri('base://tmgmt_google_test', array(
    'absolute' => TRUE,
  ))
    ->toString();
  $this->translator = $this
    ->createTranslator([
    'plugin' => 'google',
    'settings' => [
      'url' => $url,
    ],
  ]);
}