public function StyleSlideshowTest::testSlideshowWidgets in Views Slideshow 8.4
Test slideshow control widgets.
File
- src/
Tests/ Plugin/ StyleSlideshowTest.php, line 61
Class
- StyleSlideshowTest
- Tests the slideshow style views plugin.
Namespace
Drupal\views_slideshow\Tests\PluginCode
public function testSlideshowWidgets() {
$this
->drupalGet('test-style-slideshow');
// Ensure no controls are displayed.
$this
->assertFalse(count($this
->cssSelect('.views-slideshow-controls-top')));
$this
->assertFalse(count($this
->cssSelect('.views-slideshow-controls-bottom')));
// Test top widget position.
$view = View::load('test_style_slideshow');
$display =& $view
->getDisplay('default');
$display['display_options']['style']['options']['widgets'] = [
'top' => [
'views_slideshow_controls' => [
'enable' => TRUE,
'weight' => 1,
'hide_on_single_slide' => 0,
'type' => 'views_slideshow_controls_text',
],
],
];
$view
->save();
$this
->drupalGet('test-style-slideshow');
$this
->assertTrue(count($this
->cssSelect('.views-slideshow-controls-top')));
$this
->assertFalse(count($this
->cssSelect('.views-slideshow-controls-bottom')));
// Test bottom widget position.
$view = View::load('test_style_slideshow');
$display =& $view
->getDisplay('default');
$display['display_options']['style']['options']['widgets'] = [
'bottom' => [
'views_slideshow_controls' => [
'enable' => TRUE,
'weight' => 1,
'hide_on_single_slide' => 0,
'type' => 'views_slideshow_controls_text',
],
],
'top' => [],
];
$view
->save();
$this
->drupalGet('test-style-slideshow');
$this
->assertFalse(count($this
->cssSelect('.views-slideshow-controls-top')));
$this
->assertTrue(count($this
->cssSelect('.views-slideshow-controls-bottom')));
}