You are here

trait DrupalVersion in Acquia Content Hub 8.2

Drupal version trait for consistency.

@package Drupal\Tests\acquia_contenthub\Kernel\Stubs

Hierarchy

  • trait \Drupal\Tests\acquia_contenthub\Kernel\Stubs\DrupalVersion
7 files declare their use of DrupalVersion
AnonymousUserTest.php in tests/src/Kernel/EventSubscriber/EntityDataTamper/AnonymousUserTest.php
ExportTest.php in tests/src/Kernel/ExportTest.php
ImportExportTestBase.php in tests/src/Kernel/ImportExportTestBase.php
LinkFieldSerializerTest.php in tests/src/Kernel/EventSubscriber/SerializeContentField/LinkFieldSerializerTest.php
PathFieldSerializerTest.php in tests/src/Kernel/EventSubscriber/SerializeContentField/PathFieldSerializerTest.php

... See full list

File

tests/src/Kernel/Stubs/DrupalVersion.php, line 10

Namespace

Drupal\Tests\acquia_contenthub\Kernel\Stubs
View source
trait DrupalVersion {

  /**
   * Get the current version of Drupal to identify fixtures for tests.
   *
   * @return string
   *   The Drupal version string.
   */
  protected function getDrupalVersion() {
    $version = implode('.', explode('.', \Drupal::VERSION, -1));
    return "drupal-{$version}";
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DrupalVersion::getDrupalVersion protected function Get the current version of Drupal to identify fixtures for tests.