Add random key character range set

This commit is contained in:
Clemens Schwaighofer
2025-05-15 18:54:35 +09:00
parent 074d5bed4c
commit 7f0987d036
3 changed files with 71 additions and 2 deletions

View File

@@ -200,6 +200,47 @@ final class CoreLibsCreateRandomKeyTest extends TestCase
\CoreLibs\Create\RandomKey::getRandomKeyLength()
);
}
/**
* 1
*
* @return array
*/
public function setRandomKeyCharactersProvider(): array
{
return [
'lower case characters' => [
0 => "/^[a-z]+$/",
1 => ["a", "z"],
],
'lower case and upper case' => [
0 => "/^[A-Za-z]+$/",
1 => ["A", "Z"],
1 => ["a", "z"],
],
'alphanumeric' => [
0 => "/^[A-Za-z0-9]+$/",
1 => ["A", "Z"],
1 => ["a", "z"],
1 => ["0", "9"],
]
];
}
/**
* Undocumented function
*
* @covers ::setRandomKeyCharacters
* @dataProvider setRandomKeyCharactersProvider
* @testdox check setRandomKeyCharacters [$_dataName]
*
* @return void
*/
public function testSetRandomKeyCharacters(string $expected_regex, array ...$random_keys): void
{
}
}
// __END__