mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-07-17 16:39:40 +00:00
refactor: deduplicate OS-specific hotkey detection into a shared helper
This commit is contained in:
parent
5d946c52a7
commit
ec2d230d1b
5 changed files with 31 additions and 6 deletions
|
|
@ -231,6 +231,21 @@ class I18nTest extends TestCase
|
|||
Helper::rmDir($path);
|
||||
}
|
||||
|
||||
public function testGetCopyHotkey()
|
||||
{
|
||||
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)';
|
||||
$this->assertEquals('Cmd', I18n::getCopyHotkey(), 'returns Cmd on macOS');
|
||||
|
||||
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)';
|
||||
$this->assertEquals('Ctrl', I18n::getCopyHotkey(), 'returns Ctrl on Windows');
|
||||
|
||||
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (X11; Linux x86_64)';
|
||||
$this->assertEquals('Ctrl', I18n::getCopyHotkey(), 'returns Ctrl on Linux');
|
||||
|
||||
unset($_SERVER['HTTP_USER_AGENT']);
|
||||
$this->assertEquals('Ctrl', I18n::getCopyHotkey(), 'returns Ctrl when user agent absent');
|
||||
}
|
||||
|
||||
public function testMessageIdsExistInAllLanguages()
|
||||
{
|
||||
$messageIds = array();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue