function RunnerVersion::getMajor

Same name and namespace in other branches
  1. 9 core/tests/Drupal/TestTools/PhpUnitCompatibility/RunnerVersion.php \Drupal\TestTools\PhpUnitCompatibility\RunnerVersion::getMajor()
  2. 10 core/tests/Drupal/TestTools/PhpUnitCompatibility/RunnerVersion.php \Drupal\TestTools\PhpUnitCompatibility\RunnerVersion::getMajor()
  3. 11.x core/tests/Drupal/TestTools/PhpUnitCompatibility/RunnerVersion.php \Drupal\TestTools\PhpUnitCompatibility\RunnerVersion::getMajor()

Returns the major version of the PHPUnit runner being used.

Return value

int The major version of the PHPUnit runner being used.

8 calls to RunnerVersion::getMajor()
AfterSymfonyListener.php in core/tests/Drupal/Tests/Listeners/AfterSymfonyListener.php
Listens to PHPUnit test runs.
DrupalListener.php in core/tests/Drupal/Tests/Listeners/DrupalListener.php
Listens to PHPUnit test runs.
FileFieldTestBase.php in core/modules/file/tests/src/Functional/FileFieldTestBase.php
FileFieldValidateTest::testAssertFileExistsDeprecation in core/modules/file/tests/src/Functional/FileFieldValidateTest.php
Tests deprecation of the assertFileExists and assertFileNotExists methods.
HtmlOutputPrinter.php in core/tests/Drupal/Tests/Listeners/HtmlOutputPrinter.php
Defines a class for providing html output results for functional tests.

... See full list

File

core/tests/Drupal/TestTools/PhpUnitCompatibility/RunnerVersion.php, line 26

Class

RunnerVersion
Helper class to determine information about running PHPUnit version.

Namespace

Drupal\TestTools\PhpUnitCompatibility

Code

public static function getMajor() {
    return (int) explode('.', Version::id())[0];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.