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

Hardik_Patel_12 created an issue. See original summary.

siddhant.bhosale’s picture

Assigned: Unassigned » siddhant.bhosale
siddhant.bhosale’s picture

Assigned: siddhant.bhosale » Unassigned
Status: Needs review » Reviewed & tested by the community

Hi, the patch applies cleanly and the tests are run siccessfully. Looks good to be merged.

siddhant.bhosale’s picture

Status: Reviewed & tested by the community » Needs work

As per @kiamlaluno's comment on the similar issue https://www.drupal.org/project/drupal/issues/3158266,
I am changing the status to Needs work.

paulocs’s picture

Status: Needs work » Needs review
StatusFileSize
new820 bytes
new814 bytes

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

Status: Needs review » Needs work

The last submitted patch, 5: 2350569-5.patch, failed testing. View results

narendra.rajwar27’s picture

Working on test failure.

narendra.rajwar27’s picture

Status: Needs work » Needs review
StatusFileSize
new804 bytes
new680 bytes

Adding fix for test failure.

paulocs’s picture

Status: Needs review » Reviewed & tested by the community

For me patch #8 looks good.

Set to RTBC!

Cheers, Paulo.

  • catch committed 2b815f1 on 9.1.x
    Issue #3158280 by paulocs, narendra.rajwar27, Hardik_Patel_12: Remove...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2b815f1 and pushed to 9.1.x. Thanks!

Status: Fixed » Closed (fixed)

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