$page++;
if ($current_page ==
$page) { $this->
assertClass($element, 'is-active', 'Element for current page has .is-active class.'
);
$link =
$element->
find('css', 'a'
);
$this->
assertNotEmpty($link, 'Element for current page has link.'
);
$destination =
$link->
getAttribute('href'
);
// URL query string param is 0-indexed.
$this->
assertEquals('?page=' .
($page - 1
),
$destination);
} else { $this->
assertNoClass($element, 'is-active', "Element for page
$page has no .is-active class."
);
$this->
assertClass($element, 'pager__item', "Element for page
$page has .pager__item class."
);
$link =
$element->
find('css', 'a'
);
$this->
assertNotEmpty($link, "Link to page
$page found."
);
// Pager link has an attribute set in pager_test_preprocess_pager().
$this->
assertEquals('yes',
$link->
getAttribute('pager-test'
));
$destination =
$link->
getAttribute('href'
);
$this->
assertEquals('?page=' .
($page - 1
),
$destination);
} unset($elements[--
$page]);
} // Verify that no other items remain untested.