diff --git a/core/lib/Drupal/Core/Form/ConfigFormBase.php b/core/lib/Drupal/Core/Form/ConfigFormBase.php index d310dc1..704e443 100644 --- a/core/lib/Drupal/Core/Form/ConfigFormBase.php +++ b/core/lib/Drupal/Core/Form/ConfigFormBase.php @@ -15,7 +15,7 @@ /** * Base class for implementing system configuration forms. */ -abstract class ConfigFormBase extends FormBase implements ConfigFormInterface { +abstract class ConfigFormBase extends FormBase implements FormInterface, ConfigFormInterface { use ConfigFormBaseTrait; /** diff --git a/core/lib/Drupal/Core/Form/ConfigFormInterface.php b/core/lib/Drupal/Core/Form/ConfigFormInterface.php index 08335fe..4d117d3 100644 --- a/core/lib/Drupal/Core/Form/ConfigFormInterface.php +++ b/core/lib/Drupal/Core/Form/ConfigFormInterface.php @@ -7,9 +7,7 @@ namespace Drupal\Core\Form; -use Drupal\Core\Form\FormInterface; - -interface ConfigFormInterface extends FormInterface { +interface ConfigFormInterface { /** * Returns an array of configuration that are edited as part of the form. diff --git a/core/lib/Drupal/Core/Form/PluginConfigFormInterface.php b/core/lib/Drupal/Core/Form/PluginConfigFormInterface.php deleted file mode 100644 index 1e9d2cb..0000000 --- a/core/lib/Drupal/Core/Form/PluginConfigFormInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -getConfigurableInstances() as $instance) { - if ($instance instanceof \Drupal\Core\Form\PluginConfigFormInterface) { + if ($instance instanceof ConfigFormInterface) { $config_names = array_merge($config_names, $instance->getEditableConfigNames()); } } diff --git a/core/modules/aggregator/src/Plugin/AggregatorPluginSettingsBase.php b/core/modules/aggregator/src/Plugin/AggregatorPluginSettingsBase.php index 5495b25..6803a2f 100644 --- a/core/modules/aggregator/src/Plugin/AggregatorPluginSettingsBase.php +++ b/core/modules/aggregator/src/Plugin/AggregatorPluginSettingsBase.php @@ -8,9 +8,10 @@ namespace Drupal\aggregator\Plugin; use Drupal\Component\Plugin\ConfigurablePluginInterface; -use Drupal\Core\Form\PluginConfigFormInterface; +use Drupal\Core\Form\ConfigFormInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\PluginBase; +use Drupal\Core\Plugin\PluginFormInterface; /** * Base class for aggregator plugins that implement settings forms. @@ -24,7 +25,7 @@ * @see \Drupal\aggregator\Plugin\ParserInterface * @see plugin_api */ -abstract class AggregatorPluginSettingsBase extends PluginBase implements PluginConfigFormInterface, ConfigurablePluginInterface { +abstract class AggregatorPluginSettingsBase extends PluginBase implements PluginFormInterface, ConfigurablePluginInterface, ConfigFormInterface { /** * {@inheritdoc} diff --git a/core/modules/aggregator/tests/src/Unit/Form/SettingsFormTest.php b/core/modules/aggregator/tests/src/Unit/Form/SettingsFormTest.php index 2491c66..6053db0 100644 --- a/core/modules/aggregator/tests/src/Unit/Form/SettingsFormTest.php +++ b/core/modules/aggregator/tests/src/Unit/Form/SettingsFormTest.php @@ -5,13 +5,15 @@ * Contains \Drupal\aggregator\Tests\Form\SettingsFormTest. */ -namespace Drupal\aggregator\Tests\Form; +namespace Drupal\Tests\aggregator\Unit\Form; use Drupal\aggregator\Form\SettingsForm; use Drupal\Tests\UnitTestCase; /** * Tests \Drupal\aggregator\Form\SettingsForm. + * + * @group aggregator */ class SettingsFormTest extends UnitTestCase { @@ -96,7 +98,6 @@ protected function getSettingsForm(array $configs, array $definitions, array $co $settings_form = new SettingsForm( $this->getConfigFactoryStub($configs), - $this->getMock('Drupal\Core\Config\Context\ContextInterface'), $plugin_manager, $plugin_manager, $plugin_manager, @@ -104,10 +105,12 @@ protected function getSettingsForm(array $configs, array $definitions, array $co ); if (!empty($config_names)) { - $plugin = $this->getMock('Drupal\Core\Plugin\PluginConfigFormInterface'); + $plugin = $this->getMockBuilder('Drupal\aggregator\Plugin\AggregatorPluginSettingsBase') + ->disableOriginalConstructor() + ->getMock(); $plugin ->expects($this->exactly(3)) - ->method('getConfigNames') + ->method('getEditableConfigNames') ->will($this->returnValue($config_names)); $plugin_manager ->expects($this->exactly(3)) diff --git a/core/modules/search/src/SearchPageListBuilder.php b/core/modules/search/src/SearchPageListBuilder.php index f59c1cb..7b1c121 100644 --- a/core/modules/search/src/SearchPageListBuilder.php +++ b/core/modules/search/src/SearchPageListBuilder.php @@ -13,6 +13,7 @@ use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Form\ConfigFormInterface; +use Drupal\Core\Form\FormInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -22,7 +23,7 @@ * * @see \Drupal\search\Entity\SearchPage */ -class SearchPageListBuilder extends DraggableListBuilder implements ConfigFormInterface { +class SearchPageListBuilder extends DraggableListBuilder implements FormInterface, ConfigFormInterface { /** * The entities being listed. diff --git a/core/modules/system/src/Form/ImageToolkitForm.php b/core/modules/system/src/Form/ImageToolkitForm.php index ec9f8bd..f1b68bd 100644 --- a/core/modules/system/src/Form/ImageToolkitForm.php +++ b/core/modules/system/src/Form/ImageToolkitForm.php @@ -9,8 +9,8 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Form\ConfigFormBase; +use Drupal\Core\Form\ConfigFormInterface; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Form\PluginConfigFormInterface; use Drupal\Core\ImageToolkit\ImageToolkitManager; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -66,7 +66,7 @@ public function getEditableConfigNames() { $config_names = ['system.image']; foreach ($this->availableToolkits as $toolkit) { - if ($toolkit instanceof PluginConfigFormInterface) { + if ($toolkit instanceof ConfigFormInterface) { $config_names = array_merge($config_names, $toolkit->getEditableConfigNames()); } }