Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->loginAsAdmin();
     $this->addLanguage('de');
     $this->drupalPlaceBlock('system_breadcrumb_block');
 }
 function setUp()
 {
     parent::setUp();
     $this->loginAsAdmin();
     $this->addLanguage('de');
     $this->addLanguage('fr');
     $this->createNodeType('article', 'Article', TRUE);
     $this->createNodeType('page', 'Page', TRUE);
     // Enable entity translations for nodes and comments.
     $content_translation_manager = \Drupal::service('content_translation.manager');
     $content_translation_manager->setEnabled('node', 'article', TRUE);
     $content_translation_manager->setEnabled('node', 'page', TRUE);
     // Create nodes that will be used during tests.
     // NOTE that the order matters as results are read by xpath based on
     // position in the list.
     $this->nodes['page']['en'][] = $this->createTranslatableNode('page');
     $this->nodes['article']['de'][0] = $this->createTranslatableNode('article', 'de');
     $this->nodes['article']['fr'][0] = $this->createTranslatableNode('article', 'fr');
     $this->nodes['article']['en'][3] = $this->createTranslatableNode('article', 'en');
     $this->nodes['article']['en'][2] = $this->createTranslatableNode('article', 'en');
     $this->nodes['article']['en'][1] = $this->createTranslatableNode('article', 'en');
     $this->nodes['article']['en'][0] = $this->createTranslatableNode('article', 'en');
     $this->nodes['article'][LanguageInterface::LANGCODE_NOT_SPECIFIED][0] = $this->createTranslatableNode('article', LanguageInterface::LANGCODE_NOT_SPECIFIED);
     $this->nodes['article'][LanguageInterface::LANGCODE_NOT_APPLICABLE][0] = $this->createTranslatableNode('article', LanguageInterface::LANGCODE_NOT_APPLICABLE);
 }
 /**
  * {@inheritdoc}
  */
 function setUp()
 {
     parent::setUp();
     $this->loginAsAdmin(array('create translation jobs', 'submit translation jobs', 'accept translation jobs', 'administer content translation', 'access content overview', 'update content translations', 'translate any entity'));
     // Enable entity translations for entity_test_translatable_UI_skip.
     $content_translation_manager = \Drupal::service('content_translation.manager');
     $content_translation_manager->setEnabled('entity_test_translatable_UI_skip', 'entity_test_translatable_UI_skip', TRUE);
     $this->addLanguage('de');
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 function setUp()
 {
     parent::setUp();
     $this->loginAsAdmin(array('create translation jobs', 'submit translation jobs', 'accept translation jobs'));
     $this->addLanguage('de');
     $this->addLanguage('it');
     $this->addLanguage('es');
     $this->addLanguage('el');
     $this->createNodeType('article', 'Article', TRUE);
 }
 /**
  * {@inheritdoc}
  */
 function setUp()
 {
     parent::setUp();
     $this->addLanguage('de');
     $this->addLanguage('fr');
     $this->addLanguage('es');
     $this->addLanguage('el');
     $this->createNodeType('page', 'Page', TRUE);
     $this->createNodeType('article', 'Article', TRUE);
     $this->loginAsAdmin(array('create translation jobs', 'submit translation jobs', 'accept translation jobs', 'administer blocks', 'administer content translation', 'edit any article content'));
 }
Ejemplo n.º 6
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->drupalPlaceBlock('system_breadcrumb_block');
     $this->createNodeType('page', 'Page', TRUE);
     $this->createNodeType('article', 'Article', TRUE);
 }
Ejemplo n.º 7
0
 function setUp()
 {
     parent::setUp();
     $this->loginAsAdmin();
     $this->loginAsTranslator(array('translate configuration'));
     $this->addLanguage('de');
     $this->addLanguage('it');
     $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
     $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Page'));
     $this->drupalCreateContentType(array('type' => 'simplenews_issue', 'name' => 'Newsletter issue'));
 }
 /**
  * {@inheritdoc}
  */
 function setUp()
 {
     parent::setUp();
     $this->loginAsAdmin(['administer tmgmt']);
     // Create article content type.
     $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
     // Enable entity translations for entity_test_composite and node.
     $content_translation_manager = \Drupal::service('content_translation.manager');
     $content_translation_manager->setEnabled('entity_test_composite', 'entity_test_composite', TRUE);
     $content_translation_manager->setEnabled('node', 'article', TRUE);
 }
Ejemplo n.º 9
0
 /**
  * {@inheritdoc}
  */
 function setUp()
 {
     parent::setUp();
     $this->addLanguage('de');
     $filtered_html_format = FilterFormat::create(array('format' => 'filtered_html', 'name' => 'Filtered HTML'));
     $filtered_html_format->save();
     $this->drupalCreateContentType(array('type' => 'test_bundle'));
     $this->loginAsAdmin(array('create translation jobs', 'submit translation jobs', 'create test_bundle content', $filtered_html_format->getPermissionName()));
     file_unmanaged_copy(DRUPAL_ROOT . '/core/misc/druplicon.png', 'public://example.jpg');
     $this->image = File::create(array('uri' => 'public://example.jpg'));
     $this->image->save();
 }
Ejemplo n.º 10
0
 /**
  * {@inheritdoc}
  */
 function setUp()
 {
     parent::setUp();
     $filtered_html_format = FilterFormat::create(array('format' => 'filtered_html', 'name' => 'Filtered HTML'));
     $filtered_html_format->save();
     $this->addLanguage('de');
     $this->addLanguage('es');
     $this->addLanguage('el');
     // Login as translator only with limited permissions to run these tests.
     $this->loginAsTranslator(array('access administration pages', 'create translation jobs', 'submit translation jobs', $filtered_html_format->getPermissionName()), TRUE);
     $this->drupalPlaceBlock('system_breadcrumb_block');
     $this->createNodeType('page', 'Page', TRUE);
     $this->createNodeType('article', 'Article', TRUE);
 }