class MockUserLoginBlock

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockUserLoginBlock.php \Drupal\plugin_test\Plugin\plugin_test\mock_block\MockUserLoginBlock
  2. 10 core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockUserLoginBlock.php \Drupal\plugin_test\Plugin\plugin_test\mock_block\MockUserLoginBlock
  3. 9 core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockUserLoginBlock.php \Drupal\plugin_test\Plugin\plugin_test\mock_block\MockUserLoginBlock
  4. 8.9.x core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockUserLoginBlock.php \Drupal\plugin_test\Plugin\plugin_test\mock_block\MockUserLoginBlock

Mock implementation of a login block plugin used by Plugin API unit tests.

Hierarchy

Expanded class hierarchy of MockUserLoginBlock

See also

\Drupal\plugin_test\Plugin\MockBlockManager

File

core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockUserLoginBlock.php, line 14

Namespace

Drupal\plugin_test\Plugin\plugin_test\mock_block
View source
class MockUserLoginBlock extends PluginBase {
  
  /**
   * The title to display when rendering this block instance.
   *
   * @var string
   */
  protected $title;
  public function __construct(array $configuration, $plugin_id, $plugin_definition) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->title = $configuration['title'] ?? '';
  }
  
  /**
   * Returns the title of the block.
   */
  public function getTitle() {
    return $this->title;
  }

}

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