Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In Drupal 8.x, \Drupal\simpletest\WebTestBase does not declare or document the instance variable $cookies, though it's added to in curlHeaderCallback() every time the response conatins a Set-Cookie header.
Proposed resolution
Declare and document it.
Comment | File | Size | Author |
---|---|---|---|
#6 | simpletest-2262215-6.patch | 8.4 KB | tim.plunkett |
Comments
Comment #1
pwolanin CreditAttribution: pwolanin commentedComment #2
pwolanin CreditAttribution: pwolanin commentedThis is really a documentation issue
Comment #3
pwolanin CreditAttribution: pwolanin commentedAnd there are some more doc cleanup at the top of the file, including declaring the $container variable and fixing @file and removing some unused use statements.
Comment #5
pwolanin CreditAttribution: pwolanin commentedoops, conflict in the use section
Comment #6
tim.plunkettI checked these, and you're adding properties that actually exist in TestBase.
We can't really fix WebTestBase without fixing that first, and it's not that much more code, and its worth it to not document the properties in the wrong class.
Comment #7
sunHm. Not happy with that scope change...
To some extent of weirdness, those properties are not documented "on purpose"; as their current availability/visibility is a security issue of its own:
#2177079: Test classes have access to TestBase::$original* properties
I'm already working hard to fix and clean up all of this legacy code, but yeah, it takes time...
Comment #8
tim.plunkettIf you're feeling very strong about practicing "security by ignorance", than we can remove those original* properties.
But expanding this to TestBase is important, because those properties aren't specific to WebTestBase.
Comment #9
sunHonestly, I don't know what the "right" approach is with regard to the current (terrible) situation.
I'd personally prefer to not document the original* properties, so people don't know what they are and #2177079 will hopefully hide/remove them ASAP.
No objections to documenting the other properties on
TestBase
. (even though most of them belong toWebTestBase
in reality… but that can be cleaned up later on)Comment #10
pwolanin CreditAttribution: pwolanin commentedSo this needs a re-roll to remove the $original* variables?
Comment #11
pwolanin CreditAttribution: pwolanin commentedSeems it needs work if those Ned to be removed
Comment #20
quietone CreditAttribution: quietone as a volunteer commentedSimpletest was deprecated in Drupal 8.8 and removed from core in #3110862: Remove simpletest module from core. Moving to Simpletest Module