You are here

public function EntityPrintPluginManagerTest::testCreateSelectedInstance in Entity Print 8.2

Ensure that an empty plugin ID does not break the in unusual ways.

@covers ::createSelectedInstance

File

tests/src/Kernel/EntityPrintPluginManagerTest.php, line 39

Class

EntityPrintPluginManagerTest
@coversDefaultClass \Drupal\entity_print\Plugin\EntityPrintPluginManager @group entity_print

Namespace

Drupal\Tests\entity_print\Kernel

Code

public function testCreateSelectedInstance() {

  /** @var \Drupal\Core\Config\ConfigFactoryInterface $factory */
  $factory = $this->container
    ->get('config.factory');
  $config = $factory
    ->getEditable('entity_print.settings');
  $config
    ->set('print_engines', [
    'pdf_engine' => '',
  ]);
  $config
    ->save();
  $this
    ->expectException(PrintEngineException::class);
  $this->pluginManager
    ->createSelectedInstance('pdf');
}