diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php index 73a2fd4..7dc0199 100644 --- a/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -9,6 +9,7 @@ use Behat\Mink\Session; use Drupal\Component\Serialization\Json; use Drupal\Core\Database\Database; +use Drupal\Core\Installer\Exception\InstallerException; use Drupal\Core\Test\FunctionalTestSetupTrait; use Drupal\Core\Test\TestSetupTrait; use Drupal\Core\Utility\Error; @@ -395,7 +396,18 @@ protected function setUp() { // Install Drupal test site. $this->prepareEnvironment(); - $this->installDrupal(); + + try { + $this->installDrupal(); + } + catch (InstallerException $e) { + // Rethrow if it's not a PHP version error. + if (version_compare(phpversion(), DRUPAL_MINIMUM_PHP) >= 0) { + throw $e; + } + + $this->markTestSkipped($e->getMessage()); + } // Setup Mink. $this->initMink();