You are here

function ViewsLimitGroupingTests::getViewContainer in Views Grouping Row Limit 7

Helper function to get the HTML container of the view on a certain page.

Parameters

string $view_name: The name of the view.

Return value

SimpleXMLElement A SimpleXMLElement representing the view container div.

1 call to ViewsLimitGroupingTests::getViewContainer()
ViewsLimitGroupingTests::testSimpleGroupingLimit in tests/views_limit_grouping.test
Test a single level of grouping.

File

tests/views_limit_grouping.test, line 111
Contains test for views_limit_grouping module.

Class

ViewsLimitGroupingTests
Functional test class for views_limit_grouping.

Code

function getViewContainer($view_name) {
  $view_name = str_replace('_', '-', $view_name);

  // The path for all of the views in our test cases is the same as the view
  // name.
  $this
    ->drupalGet($view_name);
  $elements = $this
    ->xpath('//div[contains(string(@class),"view-' . $view_name . '")]/div[@class="view-content"]');
  $this
    ->assertEqual(count($elements), 1, t('The view container div was found.'));
  return $elements[0];
}