function IconPackManagerKernelTest::testGetExtractorFormDefaults

Test the IconPackManager::getExtractorFormDefault method.

File

core/tests/Drupal/KernelTests/Core/Theme/Icon/IconPackManagerKernelTest.php, line 150

Class

IconPackManagerKernelTest
Tests values are from test module icon_test.

Namespace

Drupal\KernelTests\Core\Theme\Icon

Code

public function testGetExtractorFormDefaults() : void {
  $actual = $this->pluginManagerIconPack
    ->getExtractorFormDefaults('test_settings');
  // @see core/modules/system/tests/modules/icon_test/icon_test.icons.yml
  $expected = [
    'width' => 32,
    'height' => 33,
    'title' => 'Default title',
    'alt' => 'Default alt',
    'select' => 400,
    'boolean' => TRUE,
    'decimal' => 66.66,
    'number' => 30,
  ];
  $this->assertSame($expected, $actual);
  $actual = $this->pluginManagerIconPack
    ->getExtractorFormDefaults('test_no_settings');
  $this->assertSame([], $actual);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.