You are here

public function DisplayAttachmentTest::testAttachment in Zircon Profile 8

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

Tests the attachment plugin.

File

core/modules/views/src/Tests/Plugin/DisplayAttachmentTest.php, line 47
Contains \Drupal\views\Tests\Plugin\DisplayAttachmentTest.

Class

DisplayAttachmentTest
Tests the attachment display plugin.

Namespace

Drupal\views\Tests\Plugin

Code

public function testAttachment() {
  $this
    ->drupalGet('test-display-attachment');
  $result = $this
    ->xpath('//div[contains(@class, "view-content")]');
  $this
    ->assertEqual(count($result), 2, 'Both actual view and the attachment is rendered.');
  $result = $this
    ->xpath('//div[contains(@class, "attachment-after")]');
  $this
    ->assertEqual(count($result), 0, 'The attachment is not rendered after the actual view.');
  $result = $this
    ->xpath('//div[contains(@class, "attachment-before")]');
  $this
    ->assertEqual(count($result), 1, 'The attachment is rendered before the actual view.');
}