// Test Full Pager.
$this->
getPreviewAJAX('test_pager_full_ajax', 'default', 5
);
// Test that the pager is present and rendered.
$elements =
$this->
xpath('//ul[contains(@class, "pager__items")]/li'
);
$this->
assertNotEmpty($elements);
// Verify elements and links to pages.
// We expect to find 5 elements: current page == 1, links to pages 2 and
// and 3, links to 'next >' and 'last >>' pages.
$this->
assertClass($elements[0
], 'is-active', 'Element for current page has .is-active class.'
);
$this->
assertNotEmpty($elements[0
]->
find('css', 'a'
), 'Element for current page has link.'
);
$this->
assertClass($elements[1
], 'pager__item', 'Element for page 2 has .pager__item class.'
);
$this->
assertNotEmpty($elements[1
]->
find('css', 'a'
), 'Link to page 2 found.'
);
$this->
assertClass($elements[2
], 'pager__item', 'Element for page 3 has .pager__item class.'
);
$this->
assertNotEmpty($elements[2
]->
find('css', 'a'
), 'Link to page 3 found.'
);
$this->
assertClass($elements[3
], 'pager__item--next', 'Element for next page has .pager__item--next class.'
);
$this->
assertNotEmpty($elements[3
]->
find('css', 'a'
), 'Link to next page found.'
);