ContentTestTranslationUITest.php 1.45 KB
Newer Older
1
2
3
4
<?php

/**
 * @file
5
 * Definition of Drupal\entity\Tests\ContentTestTranslationUITest.
6
7
 */

8
namespace Drupal\content_translation\Tests;
9
10
11
12

/**
 * Tests the Entity Test Translation UI.
 */
13
class ContentTestTranslationUITest extends ContentTranslationUITest {
14
15
16
17
18
19

  /**
   * Modules to enable.
   *
   * @var array
   */
20
  public static $modules = array('language', 'content_translation', 'entity_test');
21
22
23

  public static function getInfo() {
    return array(
24
      'name' => 'Entity Test translation UI',
25
26
      'description' => 'Tests the test content translation UI with the test entity.',
      'group' => 'Content Translation UI',
27
28
29
30
31
32
33
    );
  }

  /**
   * Overrides \Drupal\simpletest\WebTestBase::setUp().
   */
  function setUp() {
34
    // Use the entity_test_mul as this has multilingual property support.
35
    $this->entityTypeId = 'entity_test_mul';
36
37
38
39
    parent::setUp();
  }

  /**
40
   * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission().
41
   */
42
  protected function getTranslatorPermissions() {
43
    return array_merge(parent::getTranslatorPermissions(), array('administer entity_test content'));
44
45
46
  }

  /**
47
   * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getNewEntityValues().
48
49
   */
  protected function getNewEntityValues($langcode) {
50
    $user = $this->drupalCreateUser();
51
52
    return array(
      'name' => $this->randomName(),
53
      'user_id' => $user->id(),
54
55
56
57
    ) + parent::getNewEntityValues($langcode);
  }

}