namespace Drupal\KernelTests\Core\Entity;
-use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormState;
use Drupal\entity_test\Entity\EntityTestCompositeConstraint;
$errors = $this->getErrorsForEntity($entity, ['name']);
$this->assertFalse(isset($errors['name']));
$this->assertTrue(isset($errors['type']));
- $this->assertEqual($errors['type'], SafeMarkup::format('The validation failed because the value conflicts with the value in %field_name, which you cannot access.', ['%field_name' => 'name']));
+ $this->assertEqual($errors['type'], new FormattableMarkup('The validation failed because the value conflicts with the value in %field_name, which you cannot access.', ['%field_name' => 'name']));
}
/**
*/
public function testEntityLevelConstraintValidation() {
$entity = EntityTestCompositeConstraint::create([
- 'name' => 'entity-level-violation'
+ 'name' => 'entity-level-violation',
]);
$entity->save();