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
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -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;
  }