You are here

public function EnforcedIntegrityTest::testBlockIntegrity in Entity Reference Integrity 8

Test a typical config entity.

File

modules/entity_reference_integrity_enforce/tests/src/Functional/EnforcedIntegrityTest.php, line 56

Class

EnforcedIntegrityTest
Test enforcing referential integrity.

Namespace

Drupal\Tests\entity_reference_integrity_enforce\Functional

Code

public function testBlockIntegrity() {
  $block = $this
    ->placeBlock('system_branding_block', [
    'id' => 'foo',
    'label' => 'bar',
  ]);
  $this
    ->assertEntityDeleteProtected($block, 'Cannot delete "block" of type "block" with label "bar" and ID "foo" because other content is referencing it and the integrity of this entity type is enforced.');
}