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
The getStatus()
method is deprecated (since Symfony 4.3) and removed from Symfony 5.4.
Calling filterResponse() in D10 fails due to the undefined getStatus() method called on the response object which results in tests failing in modules calling this method.
- Symfony 5.4 (D10) uses getStatusCode()
- Symfony 4.4 (D9.5) uses getStatus()
Steps to reproduce
-
Proposed resolution
Change getStatus()
to getStatusCode()
in \Drupal\Tests\DrupalTestBrowser
Remaining tasks
Change getStatus()
to getStatusCode()
in \Drupal\Tests\DrupalTestBrowser
User interface changes
-
API changes
-
Data model changes
-
Release notes snippet
-
Comment | File | Size | Author |
---|---|---|---|
#9 | 3301288-9.patch | 1.29 KB | mondrake |
|
Issue fork drupal-3301288
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
balintpekkerComment #4
balintpekkerComment #5
mglamanMoving to phpunit, since it's code for testing.
Comment #6
smustgrave CreditAttribution: smustgrave at Mobomo commentedSeems like a simple change.
Comment #7
mondrakeI think this is just dead code - BigPipe implementation of filterResponse() is unrelated to here. Let's see this test only patch.
Comment #8
mondrakeLet's see if it's the entire method to be unused.
Comment #9
mondrakeMaybe we can just get rid of the entire method - it's called by the parent AbstractBrowser::request() method that the concrete DrupalTestBrowser class does not override, and the condition never triggers - so let's just fall back to the parent implementation. Classes extending DrupalTestBrowser (are there any?) and overriding ::filterResponse() would still work, just falling back to AbstractBrowser implementation as well.
Comment #11
SpokjeLooks like a no: http://codcontrib.hank.vps-private.net/search?text=extends+DrupalTestBro...
So I think this is a nice clean up.
RTBC if TestBot agrees.
Comment #12
catchCommitted/pushed to 10.1.x and cherry-picked to 10.0.x, thanks! Nice to get rid of some code.