You are here

public function EntityReferenceSupportedNewEntitiesConstraintValidatorTest::testNewEntitiesAllowedInDefaultWorkspace in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php \Drupal\Tests\workspaces\Kernel\EntityReferenceSupportedNewEntitiesConstraintValidatorTest::testNewEntitiesAllowedInDefaultWorkspace()

@covers ::validate

File

core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php, line 52

Class

EntityReferenceSupportedNewEntitiesConstraintValidatorTest
@coversDefaultClass \Drupal\workspaces\Plugin\Validation\Constraint\EntityReferenceSupportedNewEntitiesConstraintValidator @group workspaces

Namespace

Drupal\Tests\workspaces\Kernel

Code

public function testNewEntitiesAllowedInDefaultWorkspace() {
  $entity = EntityTestMulRevPub::create([
    'unsupported_reference' => [
      'entity' => EntityTest::create([]),
    ],
    'supported_reference' => [
      'entity' => EntityTest::create([]),
    ],
  ]);
  $this
    ->assertCount(0, $entity
    ->validate());
}