class TestConfigEntityWithPluginCollections

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\TestConfigEntityWithPluginCollections
  2. 8.9.x core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\TestConfigEntityWithPluginCollections
  3. 10 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\TestConfigEntityWithPluginCollections

Stub class for testing.

Hierarchy

Expanded class hierarchy of TestConfigEntityWithPluginCollections

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php, line 727

Namespace

Drupal\Tests\Core\Config\Entity
View source
class TestConfigEntityWithPluginCollections extends ConfigEntityBaseWithPluginCollections {
  
  /**
   * The plugin collection.
   *
   * @var \Drupal\Core\Plugin\DefaultLazyPluginCollection
   */
  protected $pluginCollection;
  
  /**
   * The plugin manager.
   *
   * @var \Drupal\Component\Plugin\PluginManagerInterface|\PHPUnit\Framework\MockObject\MockObject
   */
  protected $pluginManager;
  
  /**
   * The configuration for the plugin collection.
   */
  protected array $the_plugin_collection_config = [];
  public function setPluginManager(PluginManagerInterface $plugin_manager) : void {
    $this->pluginManager = $plugin_manager;
  }
  
  /**
   * {@inheritdoc}
   */
  public function getPluginCollections() {
    if (!$this->pluginCollection) {
      $this->pluginCollection = new DefaultLazyPluginCollection($this->pluginManager, $this->the_plugin_collection_config);
    }
    return [
      'the_plugin_collection_config' => $this->pluginCollection,
    ];
  }

}

Members

Title Sort descending Modifiers Object type Summary
TestConfigEntityWithPluginCollections::$pluginCollection protected property The plugin collection.
TestConfigEntityWithPluginCollections::$pluginManager protected property The plugin manager.
TestConfigEntityWithPluginCollections::$the_plugin_collection_config protected property The configuration for the plugin collection.
TestConfigEntityWithPluginCollections::getPluginCollections public function
TestConfigEntityWithPluginCollections::setPluginManager public function

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.