You are here

public function BlockFieldTest::testBlockFieldBlockContentImporterPlugin in Entity Share 8.3

Test behavior when plugin "Block field block content" is not enabled.

File

modules/entity_share_client/tests/src/Functional/BlockFieldTest.php, line 131

Class

BlockFieldTest
Functional test class for block field.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

public function testBlockFieldBlockContentImporterPlugin() {

  // First test the import when the plugin is enabled.
  $this
    ->pullEveryChannels();
  $this
    ->checkCreatedEntities();

  // Now test the import when the plugin is disabled.
  // Before that we need to delete the entities created in the previous run.
  $this
    ->removePluginFromImportConfig('block_field_block_content_importer');
  $recreated_node = $this
    ->loadEntity('node', 'es_test_block');
  $recreated_node
    ->delete();
  $recreated_block_entity = $this
    ->loadEntity('block_content', 'block_content_test');
  $recreated_block_entity
    ->delete();
  $this
    ->pullEveryChannels();
  $recreated_node = $this
    ->loadEntity('node', 'es_test_block');
  $this
    ->assertNotNull($recreated_node, 'The node with UUID es_test_block has been recreated.');
  $recreated_block_entity = $this
    ->loadEntity('block_content', 'block_content_test');
  $this
    ->assertNull($recreated_block_entity, 'The block_content with UUID block_content_test has not been recreated.');
}