You are here

protected function ContentTranslationSettingsTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php \Drupal\content_translation\Tests\ContentTranslationSettingsTest::setUp()

Sets up a Drupal site for running functional and integration tests.

Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.

Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Overrides WebTestBase::setUp

File

core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php, line 34
Contains \Drupal\content_translation\Tests\ContentTranslationSettingsTest.

Class

ContentTranslationSettingsTest
Tests the content translation settings UI.

Namespace

Drupal\content_translation\Tests

Code

protected function setUp() {
  parent::setUp();

  // Set up two content types to test fields shared between different
  // bundles.
  $this
    ->drupalCreateContentType(array(
    'type' => 'article',
  ));
  $this
    ->drupalCreateContentType(array(
    'type' => 'page',
  ));
  $this
    ->addDefaultCommentField('node', 'article', 'comment_article', CommentItemInterface::OPEN, 'comment_article');
  $this
    ->addDefaultCommentField('node', 'page', 'comment_page');
  $admin_user = $this
    ->drupalCreateUser(array(
    'access administration pages',
    'administer languages',
    'administer content translation',
    'administer content types',
    'administer node fields',
    'administer comment fields',
    'administer comments',
    'administer comment types',
    'administer account settings',
  ));
  $this
    ->drupalLogin($admin_user);
}