You are here

public function BundleConstraintValidatorTest::testValidation in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php \Drupal\KernelTests\Core\Entity\BundleConstraintValidatorTest::testValidation()

Tests bundle constraint validation.

File

core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php, line 33

Class

BundleConstraintValidatorTest
Tests validation constraints for BundleConstraintValidator.

Namespace

Drupal\KernelTests\Core\Entity

Code

public function testValidation() {

  // Test with multiple values.
  $this
    ->assertValidation([
    'foo',
    'bar',
  ]);

  // Test with a single string value as well.
  $this
    ->assertValidation('foo');
}