comparison core/modules/user/tests/src/Kernel/UserValidationTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children af1871eacc83
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
213 * The name of the field to verify. 213 * The name of the field to verify.
214 */ 214 */
215 protected function assertAllowedValuesViolation(EntityInterface $entity, $field_name) { 215 protected function assertAllowedValuesViolation(EntityInterface $entity, $field_name) {
216 $violations = $entity->validate(); 216 $violations = $entity->validate();
217 $this->assertEqual(count($violations), 1, "Allowed values violation for $field_name found."); 217 $this->assertEqual(count($violations), 1, "Allowed values violation for $field_name found.");
218 $this->assertEqual($violations[0]->getPropertyPath(), "$field_name.0.value"); 218 $this->assertEqual($violations[0]->getPropertyPath(), $field_name === 'langcode' ? "$field_name.0" : "$field_name.0.value");
219 $this->assertEqual($violations[0]->getMessage(), t('The value you selected is not a valid choice.')); 219 $this->assertEqual($violations[0]->getMessage(), t('The value you selected is not a valid choice.'));
220 } 220 }
221 221
222 } 222 }