diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php index 882e6edcd7..0ed9a3b248 100644 --- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php @@ -633,4 +633,11 @@ public function testCheckForMetaRefresh() { $this->assertSession()->pageTextContains('Test page text.'); } + public function testGetDefaultDriveInstance() { + putenv('MINK_DRIVER_ARGS=' . json_encode([NULL, ['key1' => ['key2' => ['key3' => 3, 'key3.1' => 3.1]]]])); + $this->getDefaultDriverInstance(); + $this->assertEquals([NULL, ['key1' => ['key2' => ['key3' => 3, 'key3.1' => 3.1]]]], $this->minkDefaultDriverArgs); + } + } + diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php index e7c79f380a..6ac72f30c3 100644 --- a/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -342,7 +342,7 @@ protected function initMink() { protected function getDefaultDriverInstance() { // Get default driver params from environment if availables. if ($arg_json = getenv('MINK_DRIVER_ARGS')) { - $this->minkDefaultDriverArgs = json_decode($arg_json); + $this->minkDefaultDriverArgs = json_decode($arg_json, TRUE); } // Get and check default driver class from environment if availables.