You are here

public function SlickFormatterTest::testAdminOptions in Slick Carousel 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/SlickFormatterTest.php \Drupal\Tests\slick\Kernel\SlickFormatterTest::testAdminOptions()

Tests for \Drupal\slick\Form\SlickAdmin.

@covers \Drupal\slick\Form\SlickAdmin::buildSettingsForm @covers \Drupal\slick\Form\SlickAdmin::openingForm @covers \Drupal\slick\Form\SlickAdmin::imageStyleForm @covers \Drupal\slick\Form\SlickAdmin::fieldableForm @covers \Drupal\slick\Form\SlickAdmin::mediaSwitchForm @covers \Drupal\slick\Form\SlickAdmin::gridForm @covers \Drupal\slick\Form\SlickAdmin::closingForm @covers \Drupal\slick\Form\SlickAdmin::finalizeForm @covers \Drupal\slick\Form\SlickAdmin::getOverridableOptions @covers \Drupal\slick\Form\SlickAdmin::getLayoutOptions @covers \Drupal\slick\Form\SlickAdmin::getOptionsetsByGroupOptions @covers \Drupal\slick\Form\SlickAdmin::getSkinsByGroupOptions @covers \Drupal\slick\Form\SlickAdmin::getSettingsSummary @covers \Drupal\slick\Form\SlickAdmin::getFieldOptions

File

tests/src/Kernel/SlickFormatterTest.php, line 225

Class

SlickFormatterTest
Tests the Slick field rendering using the image field type.

Namespace

Drupal\Tests\slick\Kernel

Code

public function testAdminOptions() {
  $definition = $this
    ->getSlickFormatterDefinition();
  $form['test'] = [
    '#type' => 'hidden',
  ];
  $this->slickAdmin
    ->buildSettingsForm($form, $definition);
  $this
    ->assertArrayHasKey('optionset', $form);
  $options = $this->slickAdmin
    ->getOverridableOptions();
  $this
    ->assertArrayHasKey('arrows', $options);
  $options = $this->slickAdmin
    ->getLayoutOptions();
  $this
    ->assertArrayHasKey('bottom', $options);
  $options = $this->slickAdmin
    ->getOptionsetsByGroupOptions();
  $this
    ->assertArrayHasKey('default', $options);
  $options = $this->slickAdmin
    ->getOptionsetsByGroupOptions('main');
  $this
    ->assertArrayHasKey('test', $options);
  $options = $this->slickAdmin
    ->getSkinsByGroupOptions('main');
  $this
    ->assertArrayHasKey('classic', $options);
  $summary = $this->slickAdmin
    ->getSettingsSummary($definition);
  $this
    ->assertNotEmpty($summary);
  $options = $this->slickAdmin
    ->getFieldOptions([], [], 'node');
  $this
    ->assertArrayHasKey($this->testFieldName, $options);
}