You are here

public function BlockDependenciesTest::testExposedBlock 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::testExposedBlock()

Tests that exposed filter blocks have the correct dependencies.

See also

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

File

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

Class

BlockDependenciesTest
Tests views block config dependencies functionality.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

public function testExposedBlock() {
  $block = $this
    ->createBlock('views_exposed_filter_block:test_exposed_block-page_1');
  $dependencies = $block
    ->calculateDependencies()
    ->getDependencies();
  $expected = [
    'config' => [
      'views.view.test_exposed_block',
    ],
    'module' => [
      'views',
    ],
    'theme' => [
      'stark',
    ],
  ];
  $this
    ->assertIdentical($expected, $dependencies);
}