You are here

public function ViewsBlockTest::testGetPreviewFallbackString 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::testGetPreviewFallbackString()
  2. 9 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());
}