You are here

public function AdvancedPluginSelectorBaseTest::testBuildNoAvailablePlugins in Plugin 8.2

@covers ::buildNoAvailablePlugins

File

tests/src/Unit/Plugin/Plugin/PluginSelector/AdvancedPluginSelectorBaseTest.php, line 472

Class

AdvancedPluginSelectorBaseTest
@coversDefaultClass \Drupal\plugin\Plugin\Plugin\PluginSelector\AdvancedPluginSelectorBase

Namespace

Drupal\Tests\plugin\Unit\Plugin\Plugin\PluginSelector

Code

public function testBuildNoAvailablePlugins() {
  $element = [];
  $form_state = $this
    ->createMock(FormStateInterface::class);
  $form = [];
  $label = $this
    ->randomMachineName();
  $this->sut
    ->setLabel($label);
  $expected_build = $element + [
    'select' => [
      'message' => [
        '#markup' => 'There are no available options.',
        '#title' => $label,
        '#type' => 'item',
      ],
      'container' => [
        '#type' => 'container',
        'plugin_id' => [
          '#type' => 'value',
          '#value' => NULL,
        ],
      ],
    ],
  ];
  $this
    ->assertEquals($expected_build, $this->sut
    ->buildNoAvailablePlugins($element, $form_state, $form));
}