diff -u b/core/modules/system/src/Tests/Entity/ValidReferenceConstraintValidatorTest.php b/core/modules/system/src/Tests/Entity/ValidReferenceConstraintValidatorTest.php --- b/core/modules/system/src/Tests/Entity/ValidReferenceConstraintValidatorTest.php +++ b/core/modules/system/src/Tests/Entity/ValidReferenceConstraintValidatorTest.php @@ -2,14 +2,13 @@ /** * @file - * Contains \Drupal\system\Tests\Entity\EntityTypeConstraintValidatorTest. + * Contains \Drupal\system\Tests\Entity\ValidReferenceConstraintValidatorTest. */ namespace Drupal\system\Tests\Entity; -use Drupal\system\Tests\Entity\EntityUnitTestBase; -use Drupal\system\Tests\TypedData; use Drupal\Core\Field\BaseFieldDefinition; +use Drupal\system\Tests\TypedData; /** * Tests validation constraints for ValidReferenceConstraintValidator. @@ -25,6 +24,9 @@ */ protected $typedData; + /** + * {@inheritdoc} + */ public static $modules = array('field', 'user'); /** @@ -48,7 +50,7 @@ $typed_data = $this->typedData->create($definition, array('target_id' => $entity->id())); $violations = $typed_data->validate(); - $this->assertEqual($violations->count(), 0, 'Validation passed for correct value.'); + $this->assertFalse($violations->count(), 'Validation passed for correct value.'); // NULL is also considered a valid reference. $typed_data = $this->typedData->create($definition, array('target_id' => NULL)); @@ -63,7 +65,10 @@ // Make sure the information provided by a violation is correct. $violation = $violations[0]; - $this->assertEqual($violation->getMessage(), t('The referenced entity (%type: %id) does not exist.', array('%type' => 'user', '%id' => $entity->id())), 'The message for invalid value is correct.'); + $this->assertEqual($violation->getMessage(), t('The referenced entity (%type: %id) does not exist.', array( + '%type' => 'user', + '%id' => $entity->id(), + )), 'The message for invalid value is correct.'); $this->assertEqual($violation->getRoot(), $typed_data, 'Violation root is correct.'); } }