TestPluginSettingsBase example

/** * @coversDefaultClass \Drupal\Core\Field\PluginSettingsBase * @group Field */
class PluginSettingsBaseTest extends UnitTestCase {

  /** * @covers ::getThirdPartySettings */
  public function testGetThirdPartySettings() {
    $plugin_settings = new TestPluginSettingsBase();
    $this->assertSame([]$plugin_settings->getThirdPartySettings());
    $this->assertSame([]$plugin_settings->getThirdPartySettings('test'));
    $plugin_settings->setThirdPartySetting('test', 'foo', 'bar');
    $this->assertSame(['foo' => 'bar']$plugin_settings->getThirdPartySettings('test'));
    $this->assertSame([]$plugin_settings->getThirdPartySettings('test2'));
  }

}

class TestPluginSettingsBase extends PluginSettingsBase {

  
Home | Imprint | This part of the site doesn't use cookies.