diff --git a/system/View/Plugins.php b/system/View/Plugins.php index 19b431a0fab3..7142e44c452e 100644 --- a/system/View/Plugins.php +++ b/system/View/Plugins.php @@ -85,7 +85,7 @@ public static function lang(array $params = []): string * * @param array{field?: string} $params */ - public static function ValidationErrors(array $params = []): string + public static function validationErrors(array $params = []): string { $validator = service('validation'); if ($params === []) { diff --git a/tests/system/View/ParserPluginTest.php b/tests/system/View/ParserPluginTest.php index d0295ef387b5..9d6b97dec716 100644 --- a/tests/system/View/ParserPluginTest.php +++ b/tests/system/View/ParserPluginTest.php @@ -93,6 +93,10 @@ public function testLang(): void $template = '{+ lang Number.terabyteAbbr +}'; $this->assertSame('TB', $this->parser->renderString($template)); + + $template = '{+ lang Time.years 2024 +}'; + + $this->assertSame('2,024 years', $this->parser->renderString($template)); } public function testValidationErrors(): void @@ -122,6 +126,10 @@ public function testSiteURL(): void $template = '{+ siteURL +}'; $this->assertSame('http://example.com/index.php', $this->parser->renderString($template)); + + $template = '{+ siteURL login +}'; + + $this->assertSame('http://example.com/index.php/login', $this->parser->renderString($template)); } public function testValidationErrorsList(): void