diff --git a/core/modules/simpletest/src/BrowserTestBase.php b/core/modules/simpletest/src/BrowserTestBase.php index ed64f0833d0..a2bf771e0ae 100644 --- a/core/modules/simpletest/src/BrowserTestBase.php +++ b/core/modules/simpletest/src/BrowserTestBase.php @@ -291,7 +291,7 @@ abstract class BrowserTestBase extends \PHPUnit_Framework_TestCase { // coverage against. $base_url = getenv('SIMPLETEST_BASE_URL'); if (!$base_url) { - $this->markTestSkipped( + throw new \Exception( 'You must provide a SIMPLETEST_BASE_URL environment variable to run some PHPUnit based functional tests.' ); } diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php index a0ed6a67d2e..8d629ba079a 100644 --- a/core/tests/Drupal/KernelTests/KernelTestBase.php +++ b/core/tests/Drupal/KernelTests/KernelTestBase.php @@ -406,7 +406,7 @@ abstract class KernelTestBase extends \PHPUnit_Framework_TestCase implements Ser // If the test is run with argument dburl then use it. $db_url = getenv('SIMPLETEST_DB'); if (empty($db_url)) { - $this->markTestSkipped('There is no database connection so no tests can be run. You must provide a SIMPLETEST_DB environment variable to run PHPUnit based functional tests outside of run-tests.sh. See https://www.drupal.org/node/2116263#skipped-tests for more information.'); + throw new \Exception('There is no database connection so no tests can be run. You must provide a SIMPLETEST_DB environment variable to run PHPUnit based functional tests outside of run-tests.sh. See https://www.drupal.org/node/2116263#skipped-tests for more information.'); } else { $database = Database::convertDbUrlToConnectionInfo($db_url, $this->root);