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.

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

-

Issue fork drupal-3301288

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

balintpekker created an issue. See original summary.

balintpekker’s picture

Issue summary: View changes
balintpekker’s picture

Assigned: balintpekker » Unassigned
Status: Active » Needs review
mglaman’s picture

Component: other » phpunit

Moving to phpunit, since it's code for testing.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Bug Smash Initiative

Seems like a simple change.

mondrake’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
661 bytes

I think this is just dead code - BigPipe implementation of filterResponse() is unrelated to here. Let's see this test only patch.

mondrake’s picture

Let's see if it's the entire method to be unused.

mondrake’s picture

Maybe 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.

The last submitted patch, 8: 3301288-8-test-only.patch, failed testing. View results

Spokje’s picture

Status: Needs review » Reviewed & tested by the community

Classes extending DrupalTestBrowser (are there any?)

Looks 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.

catch’s picture

Version: 10.1.x-dev » 10.0.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x and cherry-picked to 10.0.x, thanks! Nice to get rid of some code.

  • catch committed ce35df2 on 10.0.x
    Issue #3301288 by balintpekker, mondrake, mglaman: Deprecated getStatus...
  • catch committed 68c51b7 on 10.1.x
    Issue #3301288 by balintpekker, mondrake, mglaman: Deprecated getStatus...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.