3 namespace Drupal\Tests\Core\Plugin\Discovery;
5 use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
6 use Symfony\Component\DependencyInjection\ContainerInterface;
7 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
10 * Defines container test derivative discovery.
12 class TestContainerDerivativeDiscovery extends TestDerivativeDiscovery implements ContainerDeriverInterface {
15 * Constructs a TestContainerDerivativeDiscovery object.
17 * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $example_service
20 public function __construct(EventDispatcherInterface $example_service) {
26 public static function create(ContainerInterface $container, $base_plugin_id) {
27 return new static($container->get('example_service'));