You are here

public function AreaOrderTest::testAreaOrder in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Kernel/Handler/AreaOrderTest.php \Drupal\Tests\views\Kernel\Handler\AreaOrderTest::testAreaOrder()

Tests the order of the handlers.

File

core/modules/views/tests/src/Kernel/Handler/AreaOrderTest.php, line 59

Class

AreaOrderTest
Tests the view area handler.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

public function testAreaOrder() {
  $view = Views::getView('test_area_order');
  $renderable = $view
    ->buildRenderable();
  $output = $this
    ->render($renderable);
  $position_powered = strpos($output, 'block-bartik-powered');
  $position_branding = strpos($output, 'block-bartik-branding');
  $this
    ->assertNotEquals(0, $position_powered, 'ID bartik-powered found.');
  $this
    ->assertNotEquals(0, $position_branding, 'ID bartik-branding found');

  // Make sure "powered" is before "branding", so it reflects the position
  // in the configuration, and not the weight of the blocks.
  $this
    ->assertLessThan($position_branding, $position_powered);
}