+ /**
+ * @covers ::getThirdPartySetting
+ * @covers ::setThirdPartySetting
+ */
+ public function testThirdPartySettings() {
+ // Set an initial value on the section list.
+ $section_list = $this->prophesize(LayoutEntityDisplayInterface::class);
+ $section_list->getThirdPartySetting('the_module', 'the_key', NULL)->willReturn('value 1');
+ $this->plugin->setSectionList($section_list->reveal());
+
+ // The plugin returns the initial value.
+ $this->assertSame('value 1', $this->plugin->getThirdPartySetting('the_module', 'the_key'));
+
+ // When the section list is updated, also update the result returned.
+ $section_list->setThirdPartySetting('the_module', 'the_key', 'value 2')->shouldBeCalled()->will(function ($args) {
+ $this->getThirdPartySetting('the_module', 'the_key', NULL)->willReturn($args[2]);
+ });
+
+ // Update the plugin value.
+ $this->plugin->setThirdPartySetting('the_module', 'the_key', 'value 2');
+ // Assert that the returned value matches.
+ $this->assertSame('value 2', $this->plugin->getThirdPartySetting('the_module', 'the_key'));
+ }
+