Skip to content
Snippets Groups Projects
Verified Commit af58378a authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3161300 by jungle, TR, Hardik_Patel_12, Chris Burge, longwave, Kristen...

Issue #3161300 by jungle, TR, Hardik_Patel_12, Chris Burge, longwave, Kristen Pol: Improve test coverage of \Drupal\Tests\layout_builder\Unit\SectionTest::testUnsetThirdPartySetting()

(cherry picked from commit 84bae9da)
parent 464b755f
Branches
Tags
9 merge requests!1445Issue #2920039: Views' User Name exposed group filter validation,!1298Issue #3240993: Let layout builder render inline block translations,!774Issue #3174569: Example node template file name is incorrect,!497Issue #2463967: Use .user.ini file for PHP settings,!433Resolve #3163663 "Too many open files",!233Resolve #2693787 "Taxonomy term name",!133Resolve #2666286 "Clean up menuui",!112Resolve #3187004 "Drupaldatetime serialization issue",!53Resolve #3181870: Correct typo "the the" in "core/classList" deprecation message.
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment