diff --git a/core/modules/user/src/Tests/UserValidationTest.php b/core/modules/user/src/Tests/UserValidationTest.php index f5ae202..15a165e 100644 --- a/core/modules/user/src/Tests/UserValidationTest.php +++ b/core/modules/user/src/Tests/UserValidationTest.php @@ -133,6 +133,12 @@ function testValidation() { $this->assertLengthViolation($user, 'signature', 255); $user->set('signature', NULL); + // Test setting an invalid signature format. + $user->set('signature_format', $this->randomString(32)); + $violations = $user->validate(); + $this->assertEqual(count($violations), 1, 'Violation found when an invalid signature format is set.'); + $user->set('signature_format', NULL); + $user->set('timezone', $this->randomString(33)); $this->assertLengthViolation($user, 'timezone', 32); $user->set('timezone', NULL); diff --git a/core/modules/user/src/UserInterface.php b/core/modules/user/src/UserInterface.php index 6ccad91..c6f3b2a 100644 --- a/core/modules/user/src/UserInterface.php +++ b/core/modules/user/src/UserInterface.php @@ -97,15 +97,12 @@ public function setEmail($mail); public function getSignature(); /** - * Set the user signature. - * - * @todo: Convert this to a configurable field. + * Sets the user signature. * * @param string $signature * The new signature text of the user. * - * @return \Drupal\user\UserInterface - * The called user entity. + * @return $this */ public function setSignature($signature); @@ -118,13 +115,12 @@ public function setSignature($signature); public function getSignatureFormat(); /** - * Set the signature format. + * Sets the signature format. * - * @param string + * @param string $signature_format * The name of the new filter format. * - * @return \Drupal\user\UserInterface - * The called user entity. + * @return $this */ public function setSignatureFormat($signature_format);