public function SlickFormatterTest::testAdminOptions in Slick Carousel 8
Same name and namespace in other branches
- 8.2 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 228
Class
- SlickFormatterTest
- Tests the Slick field rendering using the image field type.
Namespace
Drupal\Tests\slick\KernelCode
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);
}