You are here

protected function LearningPathBrowserTestBase::setUp in Opigno Learning path 3.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/LearningPathBrowserTestBase.php \Drupal\Tests\opigno_learning_path\Functional\LearningPathBrowserTestBase::setUp()

Overrides BrowserTestBase::setUp

2 calls to LearningPathBrowserTestBase::setUp()
OpignoLinkConditionTest::setUp in tests/src/Functional/OpignoLinkConditionTest.php
OpignoModuleScoreTest::setUp in tests/src/Functional/OpignoModuleScoreTest.php
2 methods override LearningPathBrowserTestBase::setUp()
OpignoLinkConditionTest::setUp in tests/src/Functional/OpignoLinkConditionTest.php
OpignoModuleScoreTest::setUp in tests/src/Functional/OpignoModuleScoreTest.php

File

tests/src/Functional/LearningPathBrowserTestBase.php, line 52

Class

LearningPathBrowserTestBase
Provides a base class for Learning path group functional javascript tests.

Namespace

Drupal\Tests\opigno_learning_path\Functional

Code

protected function setUp() {
  parent::setUp();
  $this->entityTypeManager = $this->container
    ->get('entity_type.manager');
  $this->accountSwitcher = $this->container
    ->get('account_switcher');

  /* @var $entityFieldManager Drupal\Core\Entity\EntityFieldManager */
  $entityFieldManager = \Drupal::service('entity_field.manager');
  $fields = $entityFieldManager
    ->getFieldDefinitions('group', 'learning_path');
  if (isset($fields['field_learning_path_media_image'])) {
    $fields['field_learning_path_media_image']
      ->delete();
  }
  $this->groupCreator = $this
    ->drupalCreateUser($this
    ->getGlobalPermissions());
  $this
    ->drupalLogin($this->groupCreator);
}