function AreaOrderTest::testAreaOrder
Same name in other branches
- 9 core/modules/views/tests/src/Kernel/Handler/AreaOrderTest.php \Drupal\Tests\views\Kernel\Handler\AreaOrderTest::testAreaOrder()
- 10 core/modules/views/tests/src/Kernel/Handler/AreaOrderTest.php \Drupal\Tests\views\Kernel\Handler\AreaOrderTest::testAreaOrder()
- 11.x 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\HandlerCode
public function testAreaOrder() {
$renderer = $this->container
->get('renderer');
$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->assertTrue($position_powered < $position_branding, 'Block bartik-powered is positioned before block bartik-branding');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.