Tests the attachment plugin.
protected function testAttachment() {
// @todo Remove that once http://drupal.org/node/1828444 got in.
\Drupal::state()
->set('menu_rebuild_needed', TRUE);
$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.');
}