Problem/Motivation
In core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php file in function testConfigurableSetConfiguration() $expected['cherry'] is initialized but never used.
Proposed resolution
Remove unused $expected['cherry'] variable.
$this->defaultPluginCollection->setConfiguration(['cherry' => ['value' => 'kiwi', 'id' => 'cherry']]);
- $expected['cherry'] = ['value' => 'kiwi', 'id' => 'cherry'];
$config = $this->defaultPluginCollection->getConfiguration();
$this->assertSame(['cherry' => ['value' => 'kiwi', 'id' => 'cherry']], $config);
Comments
Comment #2
siddhant.bhosale commentedComment #3
siddhant.bhosale commentedHi, the patch applies cleanly and the tests are run siccessfully. Looks good to be merged.
Comment #4
siddhant.bhosale commentedAs per @kiamlaluno's comment on the similar issue https://www.drupal.org/project/drupal/issues/3158266,
I am changing the status to Needs work.
Comment #5
paulocsAs I see, it is ok to remove the variable, but it would be better if insert it somewhere else.
The code was inserted in #2350569: Allow external update of ConfigEntity properties that are associated with a PluginCollection and I think
$expected['cherry']was supposed to replace the array that was sent in the first parameter at:$this->assertSame(['cherry' => ['value' => 'kiwi', 'id' => 'cherry']], $config);I attached a patch and I maintained the variable and inserted it in the code mentioned above.
Cheers, Paulo.
Comment #7
narendra.rajwar27Working on test failure.
Comment #8
narendra.rajwar27Adding fix for test failure.
Comment #9
paulocsFor me patch #8 looks good.
Set to RTBC!
Cheers, Paulo.
Comment #11
catchCommitted 2b815f1 and pushed to 9.1.x. Thanks!