You are here

class DrupalContext in Views field formatter 8.2

Class DrupalContext.

Hierarchy

  • class \Drupal\Tests\views_field_formatter\Behat\DrupalContext extends \Drupal\DrupalExtension\Context\RawDrupalContext

Expanded class hierarchy of DrupalContext

File

tests/Behat/DrupalContext.php, line 14

Namespace

Drupal\Tests\views_field_formatter\Behat
View source
class DrupalContext extends RawDrupalContext {

  /**
   * Installs the test module before executing any tests.
   *
   * @param \Behat\Testwork\Hook\Scope\BeforeSuiteScope $scope
   *   The hook scope.
   *
   * @BeforeSuite
   */
  public static function installTestModule(BeforeSuiteScope $scope) : void {
    \Drupal::service('module_installer')
      ->install([
      'views_field_formatter_test',
    ]);
  }

  /**
   * Uninstalls the test module after all the tests have run.
   *
   * @param \Behat\Testwork\Hook\Scope\AfterSuiteScope $scope
   *   The hook scope.
   *
   * @AfterSuite
   */
  public static function uninstallTestModule(AfterSuiteScope $scope) : void {
    \Drupal::service('module_installer')
      ->uninstall([
      'views_field_formatter_test',
    ]);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DrupalContext::installTestModule public static function Installs the test module before executing any tests.
DrupalContext::uninstallTestModule public static function Uninstalls the test module after all the tests have run.