Skip to content

Commit

Permalink
Merge pull request #8758 from kenjis/fix-View-Plugins-ValidationErrors
Browse files Browse the repository at this point in the history
refactor: fix method name `ValidationErrors` in View\Plugins
  • Loading branch information
kenjis authored Apr 12, 2024
2 parents 22e3450 + 7f86e00 commit 4d5e012
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion system/View/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 === []) {
Expand Down
8 changes: 8 additions & 0 deletions tests/system/View/ParserPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4d5e012

Please sign in to comment.