comparison core/tests/Drupal/Tests/Component/Plugin/ConfigurablePluginInterfaceTest.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents
children
comparison
equal deleted inserted replaced
17:129ea1e6d783 18:af1871eacc83
1 <?php
2
3 namespace Drupal\Tests\Component\Plugin;
4
5 use Drupal\Component\Plugin\ConfigurablePluginInterface;
6 use Drupal\Component\Plugin\PluginBase;
7 use PHPUnit\Framework\TestCase;
8
9 /**
10 * Tests ConfigurablePluginInterface deprecation.
11 *
12 * @group legacy
13 * @group plugin
14 */
15 class ConfigurablePluginInterfaceTest extends TestCase {
16
17 /**
18 * Tests the deprecation error is thrown.
19 *
20 * @expectedDeprecation Drupal\Component\Plugin\ConfigurablePluginInterface is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. You should implement ConfigurableInterface and/or DependentPluginInterface directly as needed. If you implement ConfigurableInterface you may choose to implement ConfigurablePluginInterface in Drupal 8 as well for maximum compatibility, however this must be removed prior to Drupal 9. See https://www.drupal.org/node/2946161
21 */
22 public function testDeprecation() {
23 new ConfigurablePluginInterfaceTestClass([], '', []);
24 }
25
26 }
27
28 /**
29 * Test Class to trigger deprecation error.
30 */
31 class ConfigurablePluginInterfaceTestClass extends PluginBase implements ConfigurablePluginInterface {
32
33 /**
34 * {@inheritdoc}
35 */
36 public function getConfiguration() {
37 return [];
38 }
39
40 /**
41 * {@inheritdoc}
42 */
43 public function setConfiguration(array $configuration) {}
44
45 /**
46 * {@inheritdoc}
47 */
48 public function defaultConfiguration() {
49 return [];
50 }
51
52 /**
53 * {@inheritdoc}
54 */
55 public function calculateDependencies() {
56 return [];
57 }
58
59 }