function EntityReferenceSupportedNewEntitiesConstraintValidatorTest::testNewEntitiesAllowedInDefaultWorkspace

Same name and namespace in other branches
  1. 11.x core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php \Drupal\Tests\workspaces\Kernel\EntityReferenceSupportedNewEntitiesConstraintValidatorTest::testNewEntitiesAllowedInDefaultWorkspace()
  2. 10 core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php \Drupal\Tests\workspaces\Kernel\EntityReferenceSupportedNewEntitiesConstraintValidatorTest::testNewEntitiesAllowedInDefaultWorkspace()
  3. 9 core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php \Drupal\Tests\workspaces\Kernel\EntityReferenceSupportedNewEntitiesConstraintValidatorTest::testNewEntitiesAllowedInDefaultWorkspace()
  4. 8.9.x core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php \Drupal\Tests\workspaces\Kernel\EntityReferenceSupportedNewEntitiesConstraintValidatorTest::testNewEntitiesAllowedInDefaultWorkspace()

Tests new entities allowed in default workspace.

@legacy-covers ::validate

File

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

Class

EntityReferenceSupportedNewEntitiesConstraintValidatorTest
Tests Drupal\workspaces\Plugin\Validation\Constraint\EntityReferenceSupportedNewEntitiesConstraintValidator.

Namespace

Drupal\Tests\workspaces\Kernel

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.