From 0a00fad081c14447c9c8b0ed10906b43bb25b469 Mon Sep 17 00:00:00 2001 From: Mattias Sandstrom <1013635+tangix@users.noreply.github.com> Date: Fri, 2 Sep 2022 09:21:54 +0200 Subject: [PATCH 1/3] New fork from 4.3 branch. --- system/Language/en/CLI.php | 8 ++++---- system/Language/en/Cache.php | 2 +- system/Language/en/Core.php | 8 ++++---- system/Language/en/Database.php | 18 +++++++++--------- system/Language/en/Email.php | 6 +++--- system/Language/en/Encryption.php | 2 +- system/Language/en/Fabricator.php | 2 +- system/Language/en/Files.php | 4 ++-- system/Language/en/Filters.php | 4 ++-- system/Language/en/Format.php | 2 +- system/Language/en/HTTP.php | 16 ++++++++-------- system/Language/en/Images.php | 4 ++-- system/Language/en/Log.php | 2 +- system/Language/en/Pager.php | 4 ++-- system/Language/en/Publisher.php | 10 +++++----- system/Language/en/Router.php | 4 ++-- system/Language/en/Security.php | 2 +- system/Language/en/Session.php | 4 ++-- system/Language/en/Test.php | 2 +- system/Language/en/Validation.php | 12 ++++++------ system/Language/en/View.php | 8 ++++---- tests/system/CLI/CLITest.php | 4 ++-- tests/system/Commands/CommandTest.php | 2 +- tests/system/Database/Builder/SelectTest.php | 4 ++-- tests/system/Database/Live/ForgeTest.php | 4 ++-- .../Database/Live/SQLite/AlterTableTest.php | 2 +- tests/system/Email/EmailTest.php | 2 +- tests/system/Language/LanguageTest.php | 4 ++-- tests/system/Models/DeleteModelTest.php | 2 +- tests/system/Models/EventsModelTest.php | 2 +- tests/system/Models/FindModelTest.php | 2 +- tests/system/Models/SaveModelTest.php | 2 +- tests/system/Router/RouterTest.php | 4 ++-- tests/system/View/ParserTest.php | 2 +- 34 files changed, 80 insertions(+), 80 deletions(-) diff --git a/system/Language/en/CLI.php b/system/Language/en/CLI.php index c8f7ecae081d..29b96fd2c74a 100644 --- a/system/Language/en/CLI.php +++ b/system/Language/en/CLI.php @@ -31,9 +31,9 @@ 'commandType' => 'Command type', 'databaseGroup' => 'Database group', 'fileCreate' => 'File created: {0}', - 'fileError' => 'Error while creating file: {0}', - 'fileExist' => 'File exists: {0}', - 'fileOverwrite' => 'File overwritten: {0}', + 'fileError' => 'Error while creating file: "{0}"', + 'fileExist' => 'File exists: "{0}"', + 'fileOverwrite' => 'File overwritten: "{0}"', 'parentClass' => 'Parent class', 'returnType' => 'Return type', 'tableName' => 'Table name', @@ -43,6 +43,6 @@ 'helpDescription' => 'Description:', 'helpOptions' => 'Options:', 'helpUsage' => 'Usage:', - 'invalidColor' => 'Invalid {0} color: {1}.', + 'invalidColor' => 'Invalid "{0}" color: "{1}".', 'namespaceNotDefined' => 'Namespace "{0}" is not defined.', ]; diff --git a/system/Language/en/Cache.php b/system/Language/en/Cache.php index d119223a837f..d2abc9bedbbc 100644 --- a/system/Language/en/Cache.php +++ b/system/Language/en/Cache.php @@ -11,7 +11,7 @@ // Cache language settings return [ - 'unableToWrite' => 'Cache unable to write to {0}.', + 'unableToWrite' => 'Cache unable to write to "{0}".', 'invalidHandlers' => 'Cache config must have an array of $validHandlers.', 'noBackup' => 'Cache config must have a handler and backupHandler set.', 'handlerNotFound' => 'Cache config has an invalid handler or backup handler specified.', diff --git a/system/Language/en/Core.php b/system/Language/en/Core.php index f292bb833a01..9ab549a4c8fe 100644 --- a/system/Language/en/Core.php +++ b/system/Language/en/Core.php @@ -11,10 +11,10 @@ // Core language settings return [ - 'copyError' => 'An error was encountered while attempting to replace the file ({0}). Please make sure your file directory is writable.', + 'copyError' => 'An error was encountered while attempting to replace the file "{0}". Please make sure your file directory is writable.', 'enabledZlibOutputCompression' => 'Your zlib.output_compression ini directive is turned on. This will not work well with output buffers.', - 'invalidFile' => 'Invalid file: {0}', + 'invalidFile' => 'Invalid file: "{0}"', 'invalidPhpVersion' => 'Your PHP version must be {0} or higher to run CodeIgniter. Current version: {1}', - 'missingExtension' => 'The framework needs the following extension(s) installed and loaded: {0}.', - 'noHandlers' => '{0} must provide at least one Handler.', + 'missingExtension' => 'The framework needs the following extension(s) installed and loaded: "{0}".', + 'noHandlers' => '"{0}" must provide at least one Handler.', ]; diff --git a/system/Language/en/Database.php b/system/Language/en/Database.php index 63a18498e9f4..f0410e744aa1 100644 --- a/system/Language/en/Database.php +++ b/system/Language/en/Database.php @@ -11,9 +11,9 @@ // Database language settings return [ - 'invalidEvent' => '{0} is not a valid Model Event callback.', - 'invalidArgument' => 'You must provide a valid {0}.', - 'invalidAllowedFields' => 'Allowed fields must be specified for model: {0}', + 'invalidEvent' => '"{0}" is not a valid Model Event callback.', + 'invalidArgument' => 'You must provide a valid "{0}".', + 'invalidAllowedFields' => 'Allowed fields must be specified for model: "{0}"', 'emptyDataset' => 'There is no data to {0}.', 'emptyPrimaryKey' => 'There is no primary key defined when trying to make {0}.', 'failGetFieldData' => 'Failed to get field data from database.', @@ -21,11 +21,11 @@ 'failGetForeignKeyData' => 'Failed to get foreign key data from database.', 'parseStringFail' => 'Parsing key string failed.', 'featureUnavailable' => 'This feature is not available for the database you are using.', - 'tableNotFound' => 'Table `{0}` was not found in the current database.', - 'noPrimaryKey' => '`{0}` model class does not specify a Primary Key.', - 'noDateFormat' => '`{0}` model class does not have a valid dateFormat.', - 'fieldNotExists' => 'Field `{0}` not found.', - 'forEmptyInputGiven' => 'Empty statement is given for the field `{0}`', + 'tableNotFound' => 'Table "{0}" was not found in the current database.', + 'noPrimaryKey' => '"{0}" model class does not specify a Primary Key.', + 'noDateFormat' => '"{0}" model class does not have a valid dateFormat.', + 'fieldNotExists' => 'Field "{0}" not found.', + 'forEmptyInputGiven' => 'Empty statement is given for the field "{0}"', 'forFindColumnHaveMultipleColumns' => 'Only single column allowed in Column name.', - 'methodNotAvailable' => 'You cannot use `{1}` in `{0}`. This is a method of the `Query Builder` class.', + 'methodNotAvailable' => 'You cannot use "{1}" in "{0}". This is a method of the Query Builder Class.', ]; diff --git a/system/Language/en/Email.php b/system/Language/en/Email.php index 16ff832ee8a8..133f327058da 100644 --- a/system/Language/en/Email.php +++ b/system/Language/en/Email.php @@ -12,9 +12,9 @@ // Email language settings return [ 'mustBeArray' => 'The email validation method must be passed an array.', - 'invalidAddress' => 'Invalid email address: {0}', - 'attachmentMissing' => 'Unable to locate the following email attachment: {0}', - 'attachmentUnreadable' => 'Unable to open this attachment: {0}', + 'invalidAddress' => 'Invalid email address: "{0}"', + 'attachmentMissing' => 'Unable to locate the following email attachment: "{0}"', + 'attachmentUnreadable' => 'Unable to open this attachment: "{0}"', 'noFrom' => 'Cannot send mail with no "From" header.', 'noRecipients' => 'You must include recipients: To, Cc, or Bcc', 'sendFailurePHPMail' => 'Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.', diff --git a/system/Language/en/Encryption.php b/system/Language/en/Encryption.php index 269974fc885d..c0e7cb8276d1 100644 --- a/system/Language/en/Encryption.php +++ b/system/Language/en/Encryption.php @@ -12,7 +12,7 @@ // Encryption language settings return [ 'noDriverRequested' => 'No driver requested; Miss Daisy will be so upset!', - 'noHandlerAvailable' => 'Unable to find an available {0} encryption handler.', + 'noHandlerAvailable' => 'Unable to find an available "{0}" encryption handler.', 'unKnownHandler' => '"{0}" cannot be configured.', 'starterKeyNeeded' => 'Encrypter needs a starter key.', 'authenticationFailed' => 'Decrypting: authentication failed.', diff --git a/system/Language/en/Fabricator.php b/system/Language/en/Fabricator.php index 94140af339b2..bfedec747d91 100644 --- a/system/Language/en/Fabricator.php +++ b/system/Language/en/Fabricator.php @@ -13,5 +13,5 @@ return [ 'invalidModel' => 'Invalid model supplied for fabrication.', 'missingFormatters' => 'No valid formatters defined.', - 'createFailed' => 'Fabricator failed to insert on table {0}: {1}', + 'createFailed' => 'Fabricator failed to insert on table "{0}": {1}', ]; diff --git a/system/Language/en/Files.php b/system/Language/en/Files.php index 03fa776e4822..4506abe68690 100644 --- a/system/Language/en/Files.php +++ b/system/Language/en/Files.php @@ -11,8 +11,8 @@ // Files language settings return [ - 'fileNotFound' => 'File not found: {0}', - 'cannotMove' => 'Could not move file {0} to {1} ({2}).', + 'fileNotFound' => 'File not found: "{0}"', + 'cannotMove' => 'Could not move file "{0}" to "{1}". Reason: {2}', 'expectedDirectory' => '{0} expects a valid directory.', 'expectedFile' => '{0} expects a valid file.', ]; diff --git a/system/Language/en/Filters.php b/system/Language/en/Filters.php index fc59eaf8d005..aca478cef9bf 100644 --- a/system/Language/en/Filters.php +++ b/system/Language/en/Filters.php @@ -11,6 +11,6 @@ // Filters language settings return [ - 'noFilter' => '{0} filter must have a matching alias defined.', - 'incorrectInterface' => '{0} must implement CodeIgniter\Filters\FilterInterface.', + 'noFilter' => '"{0}" filter must have a matching alias defined.', + 'incorrectInterface' => '"{0}" must implement CodeIgniter\Filters\FilterInterface.', ]; diff --git a/system/Language/en/Format.php b/system/Language/en/Format.php index 8c06207e80d4..7c54534270aa 100644 --- a/system/Language/en/Format.php +++ b/system/Language/en/Format.php @@ -12,7 +12,7 @@ // Format language settings return [ 'invalidFormatter' => '"{0}" is not a valid Formatter class.', - 'invalidJSON' => 'Failed to parse json string, error: "{0}".', + 'invalidJSON' => 'Failed to parse JSON string. Error: {0}', 'invalidMime' => 'No Formatter defined for mime type: "{0}".', 'missingExtension' => 'The SimpleXML extension is required to format XML.', ]; diff --git a/system/Language/en/HTTP.php b/system/Language/en/HTTP.php index de34953a77d0..4467a0be1f7e 100644 --- a/system/Language/en/HTTP.php +++ b/system/Language/en/HTTP.php @@ -13,12 +13,12 @@ return [ // CurlRequest 'missingCurl' => 'CURL must be enabled to use the CURLRequest class.', - 'invalidSSLKey' => 'Cannot set SSL Key. {0} is not a valid file.', - 'sslCertNotFound' => 'SSL certificate not found at: {0}', + 'invalidSSLKey' => 'Cannot set SSL Key. "{0}" is not a valid file.', + 'sslCertNotFound' => 'SSL certificate not found at: "{0}"', 'curlError' => '{0} : {1}', // IncomingRequest - 'invalidNegotiationType' => '{0} is not a valid negotiation type. Must be one of: media, charset, encoding, language.', + 'invalidNegotiationType' => '"{0}" is not a valid negotiation type. Must be one of: media, charset, encoding, language.', // Message 'invalidHTTPProtocol' => 'Invalid HTTP Protocol Version. Must be one of: {0}', @@ -31,7 +31,7 @@ // DownloadResponse 'cannotSetBinary' => 'When setting filepath cannot set binary.', - 'cannotSetFilepath' => 'When setting binary cannot set filepath: {0}', + 'cannotSetFilepath' => 'When setting binary cannot set filepath: "{0}"', 'notFoundDownloadSource' => 'Not found download body source.', 'cannotSetCache' => 'It does not support caching for downloading.', 'cannotSetStatusCode' => 'It does not support change status code for downloading. code: {0}, reason: {1}', @@ -42,8 +42,8 @@ 'unknownStatusCode' => 'Unknown HTTP status code provided with no message: {0}', // URI - 'cannotParseURI' => 'Unable to parse URI: {0}', - 'segmentOutOfRange' => 'Request URI segment is out of range: {0}', + 'cannotParseURI' => 'Unable to parse URI: "{0}"', + 'segmentOutOfRange' => 'Request URI segment is out of range: "{0}"', 'invalidPort' => 'Ports must be between 0 and 65535. Given: {0}', 'malformedQueryString' => 'Query strings may not include URI fragments.', @@ -51,7 +51,7 @@ 'pageNotFound' => 'Page Not Found', 'emptyController' => 'No Controller specified.', 'controllerNotFound' => 'Controller or its method is not found: {0}::{1}', - 'methodNotFound' => 'Controller method is not found: {0}', + 'methodNotFound' => 'Controller method is not found: "{0}"', 'localeNotSupported' => 'Locale is not supported: {0}', // CSRF @@ -61,7 +61,7 @@ // Uploaded file moving 'alreadyMoved' => 'The uploaded file has already been moved.', 'invalidFile' => 'The original file is not a valid file.', - 'moveFailed' => 'Could not move file {0} to {1} ({2})', + 'moveFailed' => 'Could not move file "{0}" to "{1}". Reason: {2}', 'uploadErrOk' => 'The file uploaded with success.', 'uploadErrIniSize' => 'The file "%s" exceeds your upload_max_filesize ini directive.', diff --git a/system/Language/en/Images.php b/system/Language/en/Images.php index e31804ab4159..be4d52903ce4 100644 --- a/system/Language/en/Images.php +++ b/system/Language/en/Images.php @@ -22,13 +22,13 @@ 'unsupportedImageCreate' => 'Your server does not support the GD function required to process this type of image.', 'jpgOrPngRequired' => 'The image resize protocol specified in your preferences only works with JPEG or PNG image types.', 'rotateUnsupported' => 'Image rotation does not appear to be supported by your server.', - 'libPathInvalid' => 'The path to your image library is not correct. Please set the correct path in your image preferences. {0}', + 'libPathInvalid' => 'The path to your image library is not correct. Please set the correct path in your image preferences. "{0}"', 'imageProcessFailed' => 'Image processing failed. Please verify that your server supports the chosen protocol and that the path to your image library is correct.', 'rotationAngleRequired' => 'An angle of rotation is required to rotate the image.', 'invalidPath' => 'The path to the image is not correct.', 'copyFailed' => 'The image copy routine failed.', 'missingFont' => 'Unable to find a font to use.', 'saveFailed' => 'Unable to save the image. Please make sure the image and file directory are writable.', - 'invalidDirection' => 'Flip direction can be only `vertical` or `horizontal`. Given: {0}', + 'invalidDirection' => 'Flip direction can be only "vertical" or "horizontal". Given: "{0}"', 'exifNotSupported' => 'Reading EXIF data is not supported by this PHP installation.', ]; diff --git a/system/Language/en/Log.php b/system/Language/en/Log.php index 154d402b6c95..d6ee779a5fe9 100644 --- a/system/Language/en/Log.php +++ b/system/Language/en/Log.php @@ -11,6 +11,6 @@ // Log language settings return [ - 'invalidLogLevel' => '{0} is an invalid log level.', + 'invalidLogLevel' => '"{0}" is an invalid log level.', 'invalidMessageType' => 'The given message type "{0}" is not supported.', ]; diff --git a/system/Language/en/Pager.php b/system/Language/en/Pager.php index 81e6d2627cf5..884ea8e05aab 100644 --- a/system/Language/en/Pager.php +++ b/system/Language/en/Pager.php @@ -18,6 +18,6 @@ 'last' => 'Last', 'older' => 'Older', 'newer' => 'Newer', - 'invalidTemplate' => '{0} is not a valid Pager template.', - 'invalidPaginationGroup' => '{0} is not a valid Pagination group.', + 'invalidTemplate' => '"{0}" is not a valid Pager template.', + 'invalidPaginationGroup' => '"{0}" is not a valid Pagination group.', ]; diff --git a/system/Language/en/Publisher.php b/system/Language/en/Publisher.php index f335b98423f7..3eb74a3f202f 100644 --- a/system/Language/en/Publisher.php +++ b/system/Language/en/Publisher.php @@ -11,12 +11,12 @@ // Publisher language settings return [ - 'collision' => 'Publisher encountered an unexpected {0} while copying {1} to {2}.', - 'destinationNotAllowed' => 'Destination is not on the allowed list of Publisher directories: {0}', - 'fileNotAllowed' => '{0} fails the following restriction for {1}: {2}', + 'collision' => 'Publisher encountered an unexpected "{0}" while copying "{1}" to "{2}".', + 'destinationNotAllowed' => 'Destination is not on the allowed list of Publisher directories: "{0}"', + 'fileNotAllowed' => '"{0}" fails the following restriction for "{1}": {2}', // Publish Command 'publishMissing' => 'No Publisher classes detected in {0} across all namespaces.', - 'publishSuccess' => '{0} published {1} file(s) to {2}.', - 'publishFailure' => '{0} failed to publish to {1}!', + 'publishSuccess' => '"{0}" published {1} file(s) to "{2}".', + 'publishFailure' => '"{0}" failed to publish to "{1}".', ]; diff --git a/system/Language/en/Router.php b/system/Language/en/Router.php index 7d0b5cc99e25..cb90612abdd2 100644 --- a/system/Language/en/Router.php +++ b/system/Language/en/Router.php @@ -13,6 +13,6 @@ return [ 'invalidParameter' => 'A parameter does not match the expected type.', 'missingDefaultRoute' => 'Unable to determine what should be displayed. A default route has not been specified in the routing file.', - 'invalidDynamicController' => 'A dynamic controller is not allowed for security reasons. Route handler: {0}', - 'invalidControllerName' => 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: {0}', + 'invalidDynamicController' => 'A dynamic controller is not allowed for security reasons. Route handler: "{0}"', + 'invalidControllerName' => 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: "{0}"', ]; diff --git a/system/Language/en/Security.php b/system/Language/en/Security.php index 5abec93db367..d7f8a652e0b6 100644 --- a/system/Language/en/Security.php +++ b/system/Language/en/Security.php @@ -14,5 +14,5 @@ 'disallowedAction' => 'The action you requested is not allowed.', // @deprecated - 'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: {0}', + 'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: "{0}"', ]; diff --git a/system/Language/en/Session.php b/system/Language/en/Session.php index 527d2e9c7cea..03705fce2c3d 100644 --- a/system/Language/en/Session.php +++ b/system/Language/en/Session.php @@ -15,8 +15,8 @@ 'invalidSavePath' => 'Session: Configured save path "{0}" is not a directory, does not exist or cannot be created.', 'writeProtectedSavePath' => 'Session: Configured save path "{0}" is not writable by the PHP process.', 'emptySavePath' => 'Session: No save path configured.', - 'invalidSavePathFormat' => 'Session: Invalid Redis save path format: {0}', + 'invalidSavePathFormat' => 'Session: Invalid Redis save path format: "{0}"', // @deprecated - 'invalidSameSiteSetting' => 'Session: The SameSite setting must be None, Lax, Strict, or a blank string. Given: {0}', + 'invalidSameSiteSetting' => 'Session: The SameSite setting must be None, Lax, Strict, or a blank string. Given: "{0}"', ]; diff --git a/system/Language/en/Test.php b/system/Language/en/Test.php index a3f5d7ef6f02..d54b9188a668 100644 --- a/system/Language/en/Test.php +++ b/system/Language/en/Test.php @@ -11,5 +11,5 @@ // Testing language settings return [ - 'invalidMockClass' => '{0} is not a valid Mock class', + 'invalidMockClass' => '"{0}" is not a valid Mock class', ]; diff --git a/system/Language/en/Validation.php b/system/Language/en/Validation.php index 2b870eb4085f..76535c80f085 100644 --- a/system/Language/en/Validation.php +++ b/system/Language/en/Validation.php @@ -12,11 +12,11 @@ // Validation language settings return [ // Core Messages - 'noRuleSets' => 'No rulesets specified in Validation configuration.', - 'ruleNotFound' => '{0} is not a valid rule.', - 'groupNotFound' => '{0} is not a validation rules group.', - 'groupNotArray' => '{0} rule group must be an array.', - 'invalidTemplate' => '{0} is not a valid Validation template.', + 'noRuleSets' => 'No rule sets specified in Validation configuration.', + 'ruleNotFound' => '"{0}" is not a valid rule.', + 'groupNotFound' => '"{0}" is not a validation rules group.', + 'groupNotArray' => '"{0}" rule group must be an array.', + 'invalidTemplate' => '"{0}" is not a valid Validation template.', // Rule Messages 'alpha' => 'The {field} field may only contain alphabetical characters.', @@ -31,7 +31,7 @@ 'exact_length' => 'The {field} field must be exactly {param} characters in length.', 'greater_than' => 'The {field} field must contain a number greater than {param}.', 'greater_than_equal_to' => 'The {field} field must contain a number greater than or equal to {param}.', - 'hex' => 'The {field} field may only contain hexidecimal characters.', + 'hex' => 'The {field} field may only contain hexadecimal characters.', 'in_list' => 'The {field} field must be one of: {param}.', 'integer' => 'The {field} field must contain an integer.', 'is_natural' => 'The {field} field must only contain digits.', diff --git a/system/Language/en/View.php b/system/Language/en/View.php index ac94be50fd82..cd6b6c294ade 100644 --- a/system/Language/en/View.php +++ b/system/Language/en/View.php @@ -13,9 +13,9 @@ return [ 'invalidCellMethod' => '{class}::{method} is not a valid method.', 'missingCellParameters' => '{class}::{method} has no params.', - 'invalidCellParameter' => '{0} is not a valid param name.', + 'invalidCellParameter' => '"{0}" is not a valid param name.', 'noCellClass' => 'No view cell class provided.', - 'invalidCellClass' => 'Unable to locate view cell class: {0}.', - 'tagSyntaxError' => 'You have a syntax error in your Parser tags: {0}', - 'invalidDecoratorClass' => '{0} is not a valid View Decorator.', + 'invalidCellClass' => 'Unable to locate view cell class: "{0}".', + 'tagSyntaxError' => 'You have a syntax error in your Parser tags: "{0}"', + 'invalidDecoratorClass' => '"{0}" is not a valid View Decorator.', ]; diff --git a/tests/system/CLI/CLITest.php b/tests/system/CLI/CLITest.php index aec60c46aae0..3ae084557cee 100644 --- a/tests/system/CLI/CLITest.php +++ b/tests/system/CLI/CLITest.php @@ -126,7 +126,7 @@ public function testNewLine() public function testColorExceptionForeground() { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Invalid foreground color: Foreground'); + $this->expectExceptionMessage('Invalid "foreground" color: "Foreground"'); CLI::color('test', 'Foreground'); } @@ -134,7 +134,7 @@ public function testColorExceptionForeground() public function testColorExceptionBackground() { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Invalid background color: Background'); + $this->expectExceptionMessage('Invalid "background" color: "Background"'); CLI::color('test', 'white', 'Background'); } diff --git a/tests/system/Commands/CommandTest.php b/tests/system/Commands/CommandTest.php index 7a8c39940dc0..d6ec8bea9ae6 100644 --- a/tests/system/Commands/CommandTest.php +++ b/tests/system/Commands/CommandTest.php @@ -81,7 +81,7 @@ public function testCommandCall() $command = new $commands['app:info']['class']($this->logger, $this->commands); $command->bomb(); - $this->assertStringContainsString('Invalid background color:', $this->getBuffer()); + $this->assertStringContainsString('Invalid "background" color:', $this->getBuffer()); } public function testAbstractCommand() diff --git a/tests/system/Database/Builder/SelectTest.php b/tests/system/Database/Builder/SelectTest.php index 19dff466cf03..ed6204f2d2be 100644 --- a/tests/system/Database/Builder/SelectTest.php +++ b/tests/system/Database/Builder/SelectTest.php @@ -258,7 +258,7 @@ public function testSelectMinThrowsExceptionOnEmptyValue() $builder = new BaseBuilder('invoices', $this->db); $this->expectException(DataException::class); - $this->expectExceptionMessage('Empty statement is given for the field `Select`'); + $this->expectExceptionMessage('Empty statement is given for the field "Select"'); $builder->selectSum(''); } @@ -279,7 +279,7 @@ public function testSelectMinThrowsExceptionOnMultipleColumn() $builder = new BaseBuilder('users', $this->db); $this->expectException(DataException::class); - $this->expectExceptionMessage('You must provide a valid column name not separated by comma.'); + $this->expectExceptionMessage('You must provide a valid "column name not separated by comma".'); $builder->selectSum('name,role'); } diff --git a/tests/system/Database/Live/ForgeTest.php b/tests/system/Database/Live/ForgeTest.php index 9cf4817d9f36..32fc9bfcd402 100644 --- a/tests/system/Database/Live/ForgeTest.php +++ b/tests/system/Database/Live/ForgeTest.php @@ -637,7 +637,7 @@ public function testCompositeForeignKey() public function testCompositeForeignKeyFieldNotExistException() { $this->expectException(DatabaseException::class); - $this->expectExceptionMessage('Field `user_id, user_second_id` not found.'); + $this->expectExceptionMessage('Field "user_id, user_second_id" not found.'); $attributes = []; @@ -689,7 +689,7 @@ public function testCompositeForeignKeyFieldNotExistException() public function testForeignKeyFieldNotExistException() { $this->expectException(DatabaseException::class); - $this->expectExceptionMessage('Field `user_id` not found.'); + $this->expectExceptionMessage('Field "user_id" not found.'); $attributes = []; diff --git a/tests/system/Database/Live/SQLite/AlterTableTest.php b/tests/system/Database/Live/SQLite/AlterTableTest.php index 709f7ed9d808..0d3da18d1a81 100644 --- a/tests/system/Database/Live/SQLite/AlterTableTest.php +++ b/tests/system/Database/Live/SQLite/AlterTableTest.php @@ -74,7 +74,7 @@ private function dropTables() public function testFromTableThrowsOnNoTable() { $this->expectException(DataException::class); - $this->expectExceptionMessage('Table `foo` was not found in the current database.'); + $this->expectExceptionMessage('Table "foo" was not found in the current database.'); $this->table->fromTable('foo'); } diff --git a/tests/system/Email/EmailTest.php b/tests/system/Email/EmailTest.php index da428519071d..df932a488c21 100644 --- a/tests/system/Email/EmailTest.php +++ b/tests/system/Email/EmailTest.php @@ -27,7 +27,7 @@ public function testEmailValidation() $config->validate = true; $email = new Email($config); $email->setTo('invalid'); - $this->assertStringContainsString('Invalid email address: invalid', $email->printDebugger()); + $this->assertStringContainsString('Invalid email address: "invalid"', $email->printDebugger()); } public function autoClearProvider() diff --git a/tests/system/Language/LanguageTest.php b/tests/system/Language/LanguageTest.php index 58994434b3ec..bcf7be306d59 100644 --- a/tests/system/Language/LanguageTest.php +++ b/tests/system/Language/LanguageTest.php @@ -154,7 +154,7 @@ public function testLanguageDuplicateKey() $this->lang = new Language('en'); $this->assertSame('These are not the droids you are looking for', $this->lang->getLine('More.strongForce', [])); $this->assertSame('I have a very bad feeling about this', $this->lang->getLine('More.cannotMove', [])); - $this->assertSame('Could not move file {0} to {1} ({2}).', $this->lang->getLine('Files.cannotMove', [])); + $this->assertSame('Could not move file "{0}" to "{1}". Reason: {2}', $this->lang->getLine('Files.cannotMove', [])); $this->assertSame('I have a very bad feeling about this', $this->lang->getLine('More.cannotMove', [])); } @@ -206,7 +206,7 @@ public function testPrioritizedLocator() { // this should load the replacement bundle of messages $message = lang('Core.missingExtension', [], 'en'); - $this->assertSame('The framework needs the following extension(s) installed and loaded: {0}.', $message); + $this->assertSame('The framework needs the following extension(s) installed and loaded: "{0}".', $message); // and we should have our new message too $this->assertSame('billions and billions', lang('Core.bazillion', [], 'en')); } diff --git a/tests/system/Models/DeleteModelTest.php b/tests/system/Models/DeleteModelTest.php index 0e47d8535a90..3dfa9a0bbd5f 100644 --- a/tests/system/Models/DeleteModelTest.php +++ b/tests/system/Models/DeleteModelTest.php @@ -204,7 +204,7 @@ public static function emptyPkValues(): iterable public function testThrowsWithNoDateFormat(): void { $this->expectException(ModelException::class); - $this->expectExceptionMessage('`Tests\Support\Models\UserModel` model class does not have a valid dateFormat.'); + $this->expectExceptionMessage('"Tests\Support\Models\UserModel" model class does not have a valid dateFormat.'); $this->createModel(UserModel::class); $this->setPrivateProperty($this->model, 'dateFormat', ''); diff --git a/tests/system/Models/EventsModelTest.php b/tests/system/Models/EventsModelTest.php index 7cf2442036c8..96a8a429728e 100644 --- a/tests/system/Models/EventsModelTest.php +++ b/tests/system/Models/EventsModelTest.php @@ -167,7 +167,7 @@ public function testInvalidEventException(): void $this->setPrivateProperty($this->model, 'beforeInsert', ['anotherBeforeInsertMethod']); $this->expectException(DataException::class); - $this->expectExceptionMessage('anotherBeforeInsertMethod is not a valid Model Event callback.'); + $this->expectExceptionMessage('"anotherBeforeInsertMethod" is not a valid Model Event callback.'); $this->model->insert($data); } diff --git a/tests/system/Models/FindModelTest.php b/tests/system/Models/FindModelTest.php index 8f370f02f1e9..cad3ba3171c0 100644 --- a/tests/system/Models/FindModelTest.php +++ b/tests/system/Models/FindModelTest.php @@ -302,7 +302,7 @@ public function testFirstWithNoPrimaryKey(): void public function testThrowsWithNoPrimaryKey(): void { $this->expectException(ModelException::class); - $this->expectExceptionMessage('`Tests\Support\Models\UserModel` model class does not specify a Primary Key.'); + $this->expectExceptionMessage('"Tests\Support\Models\UserModel" model class does not specify a Primary Key.'); $this->createModel(UserModel::class); $this->setPrivateProperty($this->model, 'primaryKey', ''); diff --git a/tests/system/Models/SaveModelTest.php b/tests/system/Models/SaveModelTest.php index 0ff142375fde..6cb837b70c9d 100644 --- a/tests/system/Models/SaveModelTest.php +++ b/tests/system/Models/SaveModelTest.php @@ -293,7 +293,7 @@ public function testInvalidAllowedFieldException(): void ]; $this->expectException(DataException::class); - $this->expectExceptionMessage('Allowed fields must be specified for model: Tests\Support\Models\JobModel'); + $this->expectExceptionMessage('Allowed fields must be specified for model: "Tests\Support\Models\JobModel"'); $this->model->save($data); } diff --git a/tests/system/Router/RouterTest.php b/tests/system/Router/RouterTest.php index 95418fbb233c..912887a93e8c 100644 --- a/tests/system/Router/RouterTest.php +++ b/tests/system/Router/RouterTest.php @@ -423,7 +423,7 @@ public function testRouteResource() public function testRouteWithSlashInControllerName() { $this->expectExceptionMessage( - 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: \App/Admin/Admins::edit_show/$1' + 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: "\App/Admin/Admins::edit_show/$1"' ); $router = new Router($this->collection, $this->request); @@ -444,7 +444,7 @@ public function testRouteWithLeadingSlash() public function testRouteWithDynamicController() { $this->expectException(RouterException::class); - $this->expectExceptionMessage('A dynamic controller is not allowed for security reasons. Route handler: \$2::$3/$1'); + $this->expectExceptionMessage('A dynamic controller is not allowed for security reasons. Route handler: "\$2::$3/$1"'); $router = new Router($this->collection, $this->request); diff --git a/tests/system/View/ParserTest.php b/tests/system/View/ParserTest.php index ab9c0860b851..a565f4978f58 100644 --- a/tests/system/View/ParserTest.php +++ b/tests/system/View/ParserTest.php @@ -919,7 +919,7 @@ public function testRenderFindsView() public function testRenderCannotFindView() { $this->expectException(ViewException::class); - $this->expectExceptionMessageMatches('!\AInvalid file: (?:.+)View(?:/|\\\\)Views(?:/|\\\\)Simplest\.php\z!'); + $this->expectExceptionMessageMatches('!\AInvalid file: \"(?:.+)View(?:/|\\\\)Views(?:/|\\\\)Simplest\.php\"\z!'); $this->parser->setData(['testString' => 'Hello World']); $this->parser->render('Simplest'); From c9438c9358eb9e60331889c623bb0c56ae8fcf64 Mon Sep 17 00:00:00 2001 From: Mattias Sandstrom <1013635+tangix@users.noreply.github.com> Date: Fri, 2 Sep 2022 13:46:48 +0200 Subject: [PATCH 2/3] Added note to Change Log --- user_guide_src/source/changelogs/v4.3.0.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide_src/source/changelogs/v4.3.0.rst b/user_guide_src/source/changelogs/v4.3.0.rst index 90e991d5afc5..e9c745edaeda 100644 --- a/user_guide_src/source/changelogs/v4.3.0.rst +++ b/user_guide_src/source/changelogs/v4.3.0.rst @@ -116,6 +116,7 @@ Changes - Config - All atomic type properties in ``Config`` classes have been typed. - Changed the default setting to not redirect when a CSRF check fails so that it is easy to see that it is a CSRF error. +- Updated English language strings to be more consistent Deprecations ************ From be32309508f88e4eed6aaed03a6e8510d899d716 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 3 Sep 2022 07:11:38 +0900 Subject: [PATCH 3/3] docs: add missing period --- user_guide_src/source/changelogs/v4.3.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/changelogs/v4.3.0.rst b/user_guide_src/source/changelogs/v4.3.0.rst index e9c745edaeda..862185439eca 100644 --- a/user_guide_src/source/changelogs/v4.3.0.rst +++ b/user_guide_src/source/changelogs/v4.3.0.rst @@ -116,7 +116,7 @@ Changes - Config - All atomic type properties in ``Config`` classes have been typed. - Changed the default setting to not redirect when a CSRF check fails so that it is easy to see that it is a CSRF error. -- Updated English language strings to be more consistent +- Updated English language strings to be more consistent. Deprecations ************