function ViewsBlockTest::testMachineNameSuggestion

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php \Drupal\Tests\views\Kernel\Plugin\ViewsBlockTest::testMachineNameSuggestion()
  2. 10 core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php \Drupal\Tests\views\Kernel\Plugin\ViewsBlockTest::testMachineNameSuggestion()
  3. 11.x 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());
}

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