You are here

class TestBlockVariantTrait in Chaos Tool Suite (ctools) 8.3

Hierarchy

Expanded class hierarchy of TestBlockVariantTrait

File

tests/src/Unit/BlockVariantTraitTest.php, line 79

Namespace

Drupal\Tests\ctools\Unit
View source
class TestBlockVariantTrait {
  use BlockVariantTrait;

  /**
   * @var array
   */
  protected $blockConfig = [];

  /**
   * @var \Drupal\Component\Uuid\UuidInterface
   */
  protected $uuidGenerator;

  /**
   * @param \Drupal\ctools\Plugin\BlockPluginCollection $block_plugin_collection
   *
   * @return $this
   */
  public function setBlockPluginCollection(BlockPluginCollection $block_plugin_collection) {
    $this->blockPluginCollection = $block_plugin_collection;
    return $this;
  }

  /**
   * @param \Drupal\Component\Uuid\UuidInterface $uuid_generator
   *
   * @return $this
   */
  public function setUuidGenerator(UuidInterface $uuid_generator) {
    $this->uuidGenerator = $uuid_generator;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  protected function uuidGenerator() {
    return $this->uuidGenerator;
  }

  /**
   * Sets the block configuration.
   *
   * @param array $config
   *   The block configuration.
   *
   * @return $this
   */
  public function setBlockConfig(array $config) {
    $this->blockConfig = $config;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  protected function getBlockConfig() {
    return $this->blockConfig;
  }

  /**
   * {@inheritdoc}
   */
  public function getRegionNames() {
    return [
      'top' => 'Top',
      'bottom' => 'Bottom',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BlockVariantTrait::$blockManager protected property The block manager.
BlockVariantTrait::$blockPluginCollection protected property The plugin collection that holds the block plugins.
BlockVariantTrait::$eventDispatcher protected property The event dispatcher.
BlockVariantTrait::addBlock public function
BlockVariantTrait::eventDispatcher protected function Gets the event dispatcher.
BlockVariantTrait::getBlock public function
BlockVariantTrait::getBlockCollection protected function Returns the block plugins used for this display variant.
BlockVariantTrait::getBlockManager protected function Gets the block plugin manager.
BlockVariantTrait::getRegionAssignment public function
BlockVariantTrait::getRegionAssignments public function
BlockVariantTrait::getRegionName public function
BlockVariantTrait::removeBlock public function
BlockVariantTrait::updateBlock public function
TestBlockVariantTrait::$blockConfig protected property
TestBlockVariantTrait::$uuidGenerator protected property
TestBlockVariantTrait::getBlockConfig protected function Returns the configuration for stored blocks. Overrides BlockVariantTrait::getBlockConfig
TestBlockVariantTrait::getRegionNames public function Overrides BlockVariantTrait::getRegionNames
TestBlockVariantTrait::setBlockConfig public function Sets the block configuration.
TestBlockVariantTrait::setBlockPluginCollection public function
TestBlockVariantTrait::setUuidGenerator public function
TestBlockVariantTrait::uuidGenerator protected function Returns the UUID generator. Overrides BlockVariantTrait::uuidGenerator