diff --git a/core/modules/layout_builder/tests/src/Unit/SectionTest.php b/core/modules/layout_builder/tests/src/Unit/SectionTest.php index f23491835e3b1cc71a06325b982dc9ca8f0873d0..1d3e7a24ff940a7fdd022ff322c84b5af00b3a57 100644 --- a/core/modules/layout_builder/tests/src/Unit/SectionTest.php +++ b/core/modules/layout_builder/tests/src/Unit/SectionTest.php @@ -314,42 +314,42 @@ public function providerTestSetThirdPartySetting() { * @covers ::unsetThirdPartySetting * @dataProvider providerTestUnsetThirdPartySetting */ - public function testUnsetThirdPartySetting() { - $this->section->unsetThirdPartySetting('bad_judgement', 'blink_speed'); - $this->assertSame(['spin_direction' => 'clockwise'], $this->section->getThirdPartySettings('bad_judgement')); - $this->section->unsetThirdPartySetting('hunt_and_peck', 'delay'); - $this->assertSame([], $this->section->getThirdPartySettings('hunt_and_peck')); - $this->section->unsetThirdPartySetting('bad_judgement', 'non_existing_key'); - $this->section->unsetThirdPartySetting('non_existing_provider', 'non_existing_key'); + public function testUnsetThirdPartySetting($provider, $key, $expected) { + $this->section->unsetThirdPartySetting($provider, $key); + $this->assertSame($expected, $this->section->getThirdPartySettings($provider)); } /** - * Provides test data for ::testUnsetThirdPartySettings(). + * Provides test data for ::testUnsetThirdPartySetting(). */ public function providerTestUnsetThirdPartySetting() { $data = []; - $data[] = [ + $data['Key with values'] = [ 'bad_judgement', 'blink_speed', [ 'spin_direction' => 'clockwise', ], ]; - $data[] = [ + $data['Key without values'] = [ 'hunt_and_peck', 'delay', [], ]; - $data[] = [ + $data['Non-existing key'] = [ 'bad_judgement', 'non_existing_key', - [], + [ + 'blink_speed' => 'fast', + 'spin_direction' => 'clockwise', + ], ]; - $data[] = [ + $data['Non-existing provider'] = [ 'non_existing_provider', 'non_existing_key', [], ]; + return $data; }