Currently, when you set the MINK_DRIVER_ARGS variable the setting is used for all tests.
When you set them to be correct for JS tests you break the Goutte-based tests if you run them from the same phpunit command line.

Proposed resolution

Introduce additional variables to optionally override the settings for JS tests and have getters for the mink args and mink class, which could be overridden.

Remaining tasks

User interface changes

API changes

Data model changes


cspitzlay created an issue. See original summary.

cspitzlay’s picture

cspitzlay’s picture

Status: Active » Needs review
hchonov’s picture

Issue summary: View changes

Instead of overriding the :: getDefaultDriverInstance method and have the same code with only small differences twice we should introduce getters for the environment variables and override only them.

  1. +++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php
    @@ -64,6 +64,38 @@ protected function tearDown() {
    +    if ($arg_json = getenv('MINK_DRIVER_ARGS_JS')) {

    This should get

    $arg_json = $this->getMinkDriverArgs();

  2. +++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php
    @@ -64,6 +64,38 @@ protected function tearDown() {
    +    if ($minkDriverClass = getenv('MINK_DRIVER_CLASS_JS')) {

    This should get

    $mink_driver_class= $this->getMinkDriverClass();

cspitzlay’s picture

Assigned: Unassigned » cspitzlay
Status: Needs review » Needs work

Yes, that makes perfect sense. Will come up with a new patch.

cspitzlay’s picture

Assigned: cspitzlay » Unassigned
Status: Needs work » Needs review
2.76 KB

new version of the patch

hchonov’s picture

return getenv('MINK_DRIVER_ARGS_JS') ?: getenv('MINK_DRIVER_ARGS');
return getenv('MINK_DRIVER_CLASS_JS') ?: getenv('MINK_DRIVER_CLASS');

I think we should call the parent methods if the JS overrides are not defined in order to completely decouple the logic from the parent.