diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/BundleConstraintValidatorTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/BundleConstraintValidatorTest.php index 592fca9..972467f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/BundleConstraintValidatorTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/BundleConstraintValidatorTest.php @@ -2,11 +2,12 @@ /** * @file - * Contains Drupal\system\Tests\Validation\BundleConstraintValidatorTest. + * Contains Drupal\system\Tests\Entity\BundleConstraintValidatorTest. */ namespace Drupal\system\Tests\Entity; +use Drupal\Core\TypedData\DataDefinition; use Drupal\simpletest\DrupalUnitTestBase; use Drupal\system\Tests\TypedData; @@ -22,7 +23,7 @@ class BundleConstraintValidatorTest extends DrupalUnitTestBase { */ protected $typedData; - public static $modules = array('entity', 'node', 'field'); + public static $modules = array('entity', 'node', 'field', 'text'); public static function getInfo() { return array( @@ -51,16 +52,12 @@ public function testValidation() { * Executes the BundleConstraintValidator test for a given bundle. * * @param string|array $bundle - * Bundle/bundles to use as constraint. + * Bundle/bundles to use as constraint option. */ protected function assertValidation($bundle) { // Create a typed data definition with a Bundle constraint. - $definition = array( - 'type' => 'entity_reference', - 'constraints' => array( - 'Bundle' => $bundle, - ), - ); + $definition = DataDefinition::create('entity_reference') + ->addConstraint('Bundle', $bundle); // Test the validation. $article_node = $this->container->get('entity.manager')->getStorageController('node')->create(array('type' => 'foo'));