function BlockDependenciesTest::testExposedBlock

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

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