You are here

public function AdvancedPluginSelectorBaseTest::testBuildPluginFormWithoutPluginForm in Plugin 8.2

@covers ::buildPluginForm

File

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

Class

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

Namespace

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

Code

public function testBuildPluginFormWithoutPluginForm() {
  $form_state = new FormState();
  $plugin = $this
    ->createMock(PluginInspectionInterface::class);
  $method = new \ReflectionMethod($this->sut, 'buildPluginForm');
  $method
    ->setAccessible(TRUE);
  $build = $method
    ->invoke($this->sut, $form_state);
  $this
    ->assertSame('container', $build['#type']);
  $this->sut
    ->setSelectedPlugin($plugin);
  $build = $method
    ->invoke($this->sut, $form_state);
  $this
    ->assertSame('container', $build['#type']);
}