You are here

public function PluginSettingsBaseTest::testGetThirdPartySettings in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Field/PluginSettingsBaseTest.php \Drupal\Tests\Core\Field\PluginSettingsBaseTest::testGetThirdPartySettings()

@covers ::getThirdPartySettings

File

core/tests/Drupal/Tests/Core/Field/PluginSettingsBaseTest.php, line 22
Contains \Drupal\Tests\Core\Field\PluginSettingsBaseTest.

Class

PluginSettingsBaseTest
@coversDefaultClass \Drupal\Core\Field\PluginSettingsBase @group Field

Namespace

Drupal\Tests\Core\Field

Code

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'));
}