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 core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php setUp()
initializes $method_definitions
but never uses it.
$method_definitions = [
LanguageNegotiationUrl::METHOD_ID => [
'class' => '\Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl',
'weight' => 9,
],
];
Proposed resolution
$method_definitions needs to be removed from the code.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#16 | interdiff-6-16.txt | 959 bytes | jungle |
#16 | 3156345-16.patch | 1.21 KB | jungle |
Comments
Comment #2
Hardik_Patel_12 CreditAttribution: Hardik_Patel_12 at QED42 for Drupal India Association commentedComment #3
Hardik_Patel_12 CreditAttribution: Hardik_Patel_12 at QED42 for Drupal India Association commentedKindly review a patch.
Comment #5
S_Bhandari CreditAttribution: S_Bhandari at Srijan | A Material+ Company for Drupal India Association commentedComment #6
S_Bhandari CreditAttribution: S_Bhandari at Srijan | A Material+ Company for Drupal India Association commentedAdded a patch for the same.
Comment #7
ravi.shankar CreditAttribution: ravi.shankar at OpenSense Labs commentedComment #8
S_Bhandari CreditAttribution: S_Bhandari at Srijan | A Material+ Company for Drupal India Association commentedComment #9
S_Bhandari CreditAttribution: S_Bhandari at Srijan | A Material+ Company for Drupal India Association commentedComment #10
apadernoComment #11
apaderno$method_definitions
was added in #1862202: Objectify the language system, which changed the code ofPathProcessorTest::setUp()
to the following one. (The relative commit is 0b55dcd84190efb23e9db99e9fc135979aeec9bc.)Effectively,
$method_definitions
was used.Successive commits changed that code, removing the
$language_manager->expects($this->any())->method('getNegotiationMethods')->will($this->returnValue($method_definitions));
part. More exactly, it happened in commit 03fd77c842e3606da859e5bb7c04b2da0b85c720, done for #2927806: Use PHPUnit 6 for testing when PHP version >= 7.2. The committed patches contains the following lines.It removes the line using
$method_definitions
, but not the lines initializing that variable.The lines initializing
$method_definitions
are therefore a left-over that should have been removed from that patch.The patch provided here is correct.
Comment #13
apadernoComment #14
jungle#12 is a random failure. Setting back to RTBC.
Comment #15
alexpottNice sleuthing @kiamlaluno - and that was removed because these methods don't exist on the language manager and PHPUnit 6 correctly reported the error.
However looking carefully at this - this means we can also remove
and
As these lines are doing nothing too...
Comment #16
jungleThanks @alexpott for the closing look.
Addressing #15, tested the attached patch on my local, it passes. So i will cycle back and set back to RTBC once the CI run passes if no one does.
Comment #17
jungleIt's GREEN
Comment #18
alexpottCommitted and pushed 72cb9b6f06 to 9.1.x and 45f6306200 to 9.0.x and 20f191f34e to 8.9.x. Thanks!
Backported to 8.9.x to keep the tests aligned.
Comment #22
alexpott