You are here

public function StyleGridTest::testGrid in Drupal 10

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

Tests the grid style.

File

core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php, line 33

Class

StyleGridTest
Tests the grid style plugin.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

public function testGrid() {
  $view = Views::getView('test_grid');
  foreach ([
    'horizontal',
    'vertical',
  ] as $alignment) {
    $this
      ->assertGrid($view, $alignment, 5);
    $this
      ->assertGrid($view, $alignment, 4);
    $this
      ->assertGrid($view, $alignment, 3);
    $this
      ->assertGrid($view, $alignment, 2);
    $this
      ->assertGrid($view, $alignment, 1);
  }
}