Problem/Motivation

WebTestBase uses the cookies from the request object. But we create that from scratch in test setup, it never contains those cookies anymore.

Proposed resolution

Go back to using using $_COOKIE directly.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Berdir’s picture

Status: Active » Needs review
FileSize
792 bytes

I'm not sure if BrowserTestBase needs to be changed as well.

dawehner’s picture

Status: Needs review » Needs work
Issue tags: +Needs beta evaluation

We should certainly at least document why we use $_COOKIE here

jibran’s picture

Where can I read the documents about this? I know this feature is there but I don't know how to use this.

rocketeerbkw’s picture

Status: Needs work » Needs review

\Drupal::request() returns the last request on the request stack (Symfony\Component\HttpFoundation\RequestStack). When I was debugging this, the stack had at least 5 request objects in it, none of the later ones had cookies.

I don't know why there are so many, but I know that the first one in the stack has all the cookies in it, so I changed the code to get the first request object in the stack. This fixed it for me, and it doesn't have to use $_COOKIE global.

rocketeerbkw’s picture

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

juampynr’s picture

Version: 8.1.x-dev » 8.2.x-dev
FileSize
223.42 KB

I just verified that the patch at #6 gets the cookie information from the master request:

debugger

However, I don't know what to set to the XDEBUG_SESSION cookie so the correct info is then added to get/post request to the child site. I tried running document.cookie="document.cookie="XDEBUG_SESSION=xdebug;path=/"; just before clicking "Run tests" and even though I can see the cookie in the above screenshot, this does not add the XDEBUG_SESSION_START parameter to child requests.

@rocketeerbkw, how do you do it?

On a side note, once we fix this issue we should update [#30011]

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

juampynr’s picture

Since I changed to PHPStorm I am not facing this error again by upping the Number of connection settings. Shall we close this issue?

@rocketeerbkw, do you still experience this issue?

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Component: simpletest.module » phpunit

Triaging issues in simpletest.module as part of the Bug Smash Initiative to determine if they should be in the Simpletest Project or core.

This looks like it a Phpunit issue, changing component.

mondrake’s picture

Status: Needs review » Closed (outdated)

Well this one seems definitely outdated. If still applies for BrowserTestBase, please ipen a new issue.