mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03:00
The virtual-address overview currently shows a blank search box with only a hard-coded English tooltip. Add a visible translated placeholder and an accessible name: "Search mailboxes and aliases..." (Spanish: "Buscar buzones y alias..."). thanks @TrapoSAMA
25 lines
1.1 KiB
PHP
25 lines
1.1 KiB
PHP
<?php
|
|
|
|
class VirtualSearchTemplateTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
public function testSearchHintIsTranslatedAndKeepsTheExistingRequestContract(): void
|
|
{
|
|
global $CONF;
|
|
|
|
$smarty = new \Smarty\Smarty();
|
|
$smarty->setCompileDir(sys_get_temp_dir());
|
|
$smarty->setTemplateDir(__DIR__ . '/../templates');
|
|
foreach (['en', 'es'] as $language) {
|
|
$PALANG = [];
|
|
require __DIR__ . '/../languages/' . $language . '.lang';
|
|
$smarty->assign('PALANG', $PALANG);
|
|
$html = $smarty->fetch('virtual-search.tpl');
|
|
self::assertStringContainsString('method="post" action="list-virtual.php"', $html);
|
|
self::assertStringContainsString('name="search[_]"', $html);
|
|
self::assertStringContainsString('placeholder="' . $PALANG['search_mailboxes_aliases'] . '"', $html);
|
|
self::assertStringContainsString('aria-label="' . $PALANG['search_mailboxes_aliases'] . '"', $html);
|
|
}
|
|
self::assertStringContainsString("{include file='virtual-search.tpl'}", file_get_contents(__DIR__ . '/../templates/list-virtual.tpl'));
|
|
}
|
|
}
|