You are here

public function BlockDependenciesTest::testViewsBlock in Drupal 8

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

Tests that exposed filter blocks have the correct dependencies.

See also

\Drupal\views\Plugin\Derivative\ViewsBlock::getDerivativeDefinitions()

File

core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php, line 50

Class

BlockDependenciesTest
Tests views block config dependencies functionality.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

public function testViewsBlock() {
  $block = $this
    ->createBlock('views_block:content_recent-block_1');
  $dependencies = $block
    ->calculateDependencies()
    ->getDependencies();
  $expected = [
    'config' => [
      'views.view.content_recent',
    ],
    'module' => [
      'views',
    ],
    'theme' => [
      'stark',
    ],
  ];
  $this
    ->assertIdentical($expected, $dependencies);
}