function ViewsBlockTest::testGetPreviewFallbackString

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php \Drupal\Tests\views\Kernel\Plugin\ViewsBlockTest::testGetPreviewFallbackString()
  2. 10 core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php \Drupal\Tests\views\Kernel\Plugin\ViewsBlockTest::testGetPreviewFallbackString()
  3. 11.x core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php \Drupal\Tests\views\Kernel\Plugin\ViewsBlockTest::testGetPreviewFallbackString()

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

See also

\Drupal\views\Plugin\Block\ViewsBlockBase::getPreviewFallbackString()

File

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

Class

ViewsBlockTest
Tests native behaviors of the block views plugin.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

public function testGetPreviewFallbackString() {
    $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('"test_view_block::block_1" views block', $views_block->getPreviewFallbackString());
}

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