1 views_handler_field_dropbutton.test public ViewsHandlerFieldDropbuttonTest::testDropbutton()

Tests dropbutton display.

File

core/modules/views/tests/handlers/views_handler_field_dropbutton.test, line 17
Tests dropbutton functionality of Views.

Class

ViewsHandlerFieldDropbuttonTest
Tests dropbutton functionality of views.

Code

public function testDropbutton() {
  // Create a node to test the listing.
  $node = $this->backdropCreateNode();
  $this->backdropGet('views_test/dropbutton');
  $result = $this->xpath('//ul[contains(@class, dropbutton)]/li/a[contains(@href, :path) and text()=:title]', array(':path' => url('node/' . $node->nid), ':title' => 'view'));
  $this->assertEqual(count($result), 1, 'Node node view link found in dropbutton.');
  $result = $this->xpath('//ul[contains(@class, dropbutton)]/li/a[contains(@href, :path) and text()=:title]', array(':path' => url('node/' . $node->nid), ':title' => 'custom'));
  $this->assertEqual(count($result), 1, 'Custom link to node found in dropbutton.');
}