You are here

public function ViewsBlockTest::testMachineNameSuggestion in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php \Drupal\Tests\views\Kernel\Plugin\ViewsBlockTest::testMachineNameSuggestion()
  2. 9 core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php \Drupal\Tests\views\Kernel\Plugin\ViewsBlockTest::testMachineNameSuggestion()

Tests that ViewsBlock::getMachineNameSuggestion() produces the right value.

See also

\Drupal\views\Plugin\Block::getmachineNameSuggestion()

File

core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php, line 45

Class

ViewsBlockTest
Tests native behaviors of the block views plugin.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

public function testMachineNameSuggestion() {
  $plugin_definition = [
    'provider' => 'views',
  ];
  $plugin_id = 'views_block:test_view_block-block_1';
  $views_block = ViewsBlock::create($this->container, [], $plugin_id, $plugin_definition);
  $this
    ->assertEquals('views_block__test_view_block_block_1', $views_block
    ->getMachineNameSuggestion());
}