diff --git a/core/modules/system/src/Tests/Entity/Element/EntityAutocompleteElementFormTest.php b/core/modules/system/src/Tests/Entity/Element/EntityAutocompleteElementFormTest.php index 0fdd9af..6cdef4d 100644 --- a/core/modules/system/src/Tests/Entity/Element/EntityAutocompleteElementFormTest.php +++ b/core/modules/system/src/Tests/Entity/Element/EntityAutocompleteElementFormTest.php @@ -259,7 +259,7 @@ public function testInvalidEntityAutocompleteElement() { ]); $form_builder->submitForm($this, $form_state); $this->assertEqual(count($form_state->getErrors()), 1); - $this->assertEqual($form_state->getErrors()['single'], t('The referenced entity (%type: %id) does not exist.', array('%type' => 'entity_test', '%id' => 42))); + $this->assertEqual($form_state->getErrors()['single'], t('This entity (%type: %id) cannot be referenced.', array('%type' => 'entity_test', '%id' => 42))); // Do the same tests as above but on an element with '#validate_reference' // set to FALSE. diff --git a/core/modules/system/src/Tests/Entity/EntityReferenceFieldTest.php b/core/modules/system/src/Tests/Entity/EntityReferenceFieldTest.php index f74410f..3195e1d 100644 --- a/core/modules/system/src/Tests/Entity/EntityReferenceFieldTest.php +++ b/core/modules/system/src/Tests/Entity/EntityReferenceFieldTest.php @@ -103,7 +103,7 @@ public function testEntityReferenceFieldValidation() { $entity->{$this->fieldName}->target_id = 9999; $violations = $entity->{$this->fieldName}->validate(); $this->assertEqual($violations->count(), 1, 'Validation throws a violation.'); - $this->assertEqual($violations[0]->getMessage(), t('The referenced entity (%type: %id) does not exist.', array('%type' => $this->referencedEntityType, '%id' => 9999))); + $this->assertEqual($violations[0]->getMessage(), t('This entity (%type: %id) cannot be referenced.', array('%type' => $this->referencedEntityType, '%id' => 9999))); // @todo Implement a test case for invalid bundle references after // https://www.drupal.org/node/2064191 is fixed. diff --git a/core/modules/system/src/Tests/Entity/EntityValidationTest.php b/core/modules/system/src/Tests/Entity/EntityValidationTest.php index aa85fa7..81951df 100644 --- a/core/modules/system/src/Tests/Entity/EntityValidationTest.php +++ b/core/modules/system/src/Tests/Entity/EntityValidationTest.php @@ -165,7 +165,7 @@ protected function checkValidation($entity_type) { $test_entity->set('user_id', 9999); $violations = $test_entity->validate(); $this->assertEqual($violations->count(), 1, 'Validation failed.'); - $this->assertEqual($violations[0]->getMessage(), t('The referenced entity (%type: %id) does not exist.', array('%type' => 'user', '%id' => 9999))); + $this->assertEqual($violations[0]->getMessage(), t('This entity (%type: %id) cannot be referenced.', array('%type' => 'user', '%id' => 9999))); $test_entity = clone $entity; $test_entity->field_test_text->format = $this->randomString(33); diff --git a/core/modules/system/src/Tests/Entity/ValidReferenceConstraintValidatorTest.php b/core/modules/system/src/Tests/Entity/ValidReferenceConstraintValidatorTest.php index ef38189..d81a124 100644 --- a/core/modules/system/src/Tests/Entity/ValidReferenceConstraintValidatorTest.php +++ b/core/modules/system/src/Tests/Entity/ValidReferenceConstraintValidatorTest.php @@ -65,7 +65,7 @@ public function testValidation() { // 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( + $this->assertEqual($violation->getMessage(), t('This entity (%type: %id) cannot be referenced.', array( '%type' => 'user', '%id' => $entity->id(), )), 'The message for invalid value is correct.'); diff --git a/core/modules/taxonomy/src/Tests/TermValidationTest.php b/core/modules/taxonomy/src/Tests/TermValidationTest.php index b369737..a0db7fc 100644 --- a/core/modules/taxonomy/src/Tests/TermValidationTest.php +++ b/core/modules/taxonomy/src/Tests/TermValidationTest.php @@ -63,7 +63,7 @@ public function testValidation() { $term->set('parent', 9999); $violations = $term->validate(); $this->assertEqual(count($violations), 1, 'Violation found when term parent is invalid.'); - $this->assertEqual($violations[0]->getMessage(), format_string('The referenced entity (%type: %id) does not exist.', array('%type' => 'taxonomy_term', '%id' => 9999))); + $this->assertEqual($violations[0]->getMessage(), format_string('This entity (%type: %id) cannot be referenced.', array('%type' => 'taxonomy_term', '%id' => 9999))); $term->set('parent', 0); $violations = $term->validate(); diff --git a/core/modules/user/src/Tests/UserValidationTest.php b/core/modules/user/src/Tests/UserValidationTest.php index f39e11e..f7d2ffa 100644 --- a/core/modules/user/src/Tests/UserValidationTest.php +++ b/core/modules/user/src/Tests/UserValidationTest.php @@ -179,7 +179,7 @@ function testValidation() { $violations = $user->validate(); $this->assertEqual(count($violations), 1); $this->assertEqual($violations[0]->getPropertyPath(), 'roles.1'); - $this->assertEqual($violations[0]->getMessage(), t('The referenced entity (%entity_type: %name) does not exist.', array('%entity_type' => 'user_role', '%name' => 'unknown_role'))); + $this->assertEqual($violations[0]->getMessage(), t('This entity (%entity_type: %name) cannot be referenced.', array('%entity_type' => 'user_role', '%name' => 'unknown_role'))); } /**