/**
  * {@inheritdoc}
  */
 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]]);
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     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()]);
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 function setUp()
 {
     parent::setUp();
     // Login as admin to be able to set environment variables.
     $this->loginAsAdmin();
     $this->addLanguage('es');
     $this->addLanguage('sk');
     $this->addLanguage('cs');
     // Login as translator only with limited permissions to run these tests.
     $this->loginAsTranslator(array('access administration pages', 'create translation jobs', 'submit translation jobs'), TRUE);
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 function setUp()
 {
     parent::setUp();
     // Login as admin to be able to set environment variables.
     $this->loginAsAdmin();
     $this->addLanguage('de');
     $this->addLanguage('es');
     $this->addLanguage('el');
     // Login as translation administrator to run these tests.
     $this->loginAsTranslator(array('administer tmgmt'), TRUE);
 }
Esempio n. 5
0
 /**
  * {@inheritdoc}
  */
 function setUp()
 {
     parent::setUp();
     $this->langcode = 'de';
     $this->context = 'default';
     file_unmanaged_copy(drupal_get_path('module', 'tmgmt_locale') . '/tests/test.de.po', 'translations://', FILE_EXISTS_REPLACE);
     $file = new \stdClass();
     $file->uri = \Drupal::service('file_system')->realpath(drupal_get_path('module', 'tmgmt_locale') . '/tests/test.xx.po');
     $file->langcode = $this->langcode;
     Gettext::fileToDatabase($file, array());
     $this->addLanguage($this->langcode);
     $this->addLanguage('gsw-berne');
 }
Esempio n. 6
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->addLanguage('de');
     $this->translator = $this->createTranslator(['plugin' => 'microsoft', 'settings' => ['url' => URL::fromUri('base://tmgmt_microsoft_mock/v2/Http.svc', array('absolute' => TRUE))->toString()]]);
 }
Esempio n. 7
0
 /**
  * {@inheritdoc}
  */
 function setUp()
 {
     parent::setUp();
     $this->loginAsAdmin();
     $this->addLanguage('de');
 }