From 5afd2c9843ce8cfe31a687d3402b93382a5c7b22 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sat, 10 Apr 2021 20:43:30 +0000 Subject: [PATCH] Duplicate src/Util/Exception/NicknameTooLongException.php history in src/Util/Exception/NicknameTooShortException.php history. --- .../NicknameTooShortException.php} | 29 +++++++++++++++---- .../ActorArrayTransformerTest.php | 2 ++ 2 files changed, 26 insertions(+), 5 deletions(-) rename src/Util/{Functional.php => Exception/NicknameTooShortException.php} (50%) rename tests/Util/Form/{ActorArrayTransformer => }/ActorArrayTransformerTest.php (99%) diff --git a/src/Util/Functional.php b/src/Util/Exception/NicknameTooShortException.php similarity index 50% rename from src/Util/Functional.php rename to src/Util/Exception/NicknameTooShortException.php index 0cc75bcc51..d9756569ef 100644 --- a/src/Util/Functional.php +++ b/src/Util/Exception/NicknameTooShortException.php @@ -1,6 +1,7 @@ . + // }}} /** - * Functional utilities + * Nickname too long exception * + * @category Exception * @package GNUsocial - * @category Util + * + * @author Zach Copley + * @copyright 2010 StatusNet Inc. + * @author Brion Vibber + * @author Mikael Nordfeldth + * @author Nym Coy + * @copyright 2009-2014 Free Software Foundation, Inc http://www.fsf.org + * @auuthor Daniel Supernault + * @auuthor Diogo Cordeiro * * @author Hugo Sales - * @copyright 2020-2021 Free Software Foundation, Inc http://www.fsf.org + * @copyright 2018-2021 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ -namespace App\Util; +namespace App\Util\Exception; -abstract class Functional +use function App\Core\I18n\_m; +use App\Util\Nickname; + +class NicknameTooLongException extends NicknameInvalidException { + protected function defaultMessage(): string + { + // TRANS: Validation error in form for registration, profile and group settings, etc. + return _m('Nickname cannot be more than # character long.', ['count' => Nickname::MAX_LEN]); + } } diff --git a/tests/Util/Form/ActorArrayTransformer/ActorArrayTransformerTest.php b/tests/Util/Form/ActorArrayTransformerTest.php similarity index 99% rename from tests/Util/Form/ActorArrayTransformer/ActorArrayTransformerTest.php rename to tests/Util/Form/ActorArrayTransformerTest.php index 6f8714d816..049c9598cd 100644 --- a/tests/Util/Form/ActorArrayTransformer/ActorArrayTransformerTest.php +++ b/tests/Util/Form/ActorArrayTransformerTest.php @@ -1,4 +1,5 @@ transform($testArr)); } + public function testReverseTransform() { $testString = '';