Unverified Commit af58378a authored by larowlan's avatar larowlan

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
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment