You are here

public function StyleGridTest::testGrid in Zircon Profile 8

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

Tests the grid style.

File

core/modules/views/src/Tests/Plugin/StyleGridTest.php, line 44
Contains \Drupal\views\Tests\Plugin\StyleGridTest.

Class

StyleGridTest
Tests the grid style plugin.

Namespace

Drupal\views\Tests\Plugin

Code

public function testGrid() {
  $view = Views::getView('test_grid');
  foreach (array(
    '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);
  }

  // Ensure styles are properly added for grid views.
  $this
    ->drupalGet('test-grid');
  $this
    ->assertRaw('stable/css/views/views.module.css');
}