phpunit script update, SmartyExtended allow load of plugins
- phpunit has better options set for testdox/php version - SmartyExtended has logger class as option (argument 2) and options - SmartyExtneded can via option set html escape and load of plugins - plugin array is set of - file: path to plugin file - type: what type this is - tag: tag name - callable: the callable for the tag name - will throw exceptions on plugin load - for all other things will set warning only and skip read - fix the Smarty call with the logger option - fix password test for PHP 8.4 password hash change *IMPORTANT* SmartyExtended($l10n, $logger, $cache_id, $compile_id) The second argument is now the Logger class, this MUST be updated for all calls
This commit is contained in:
@@ -13,6 +13,11 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
final class CoreLibsSecurityPasswordTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function passwordProvider(): array
|
||||
{
|
||||
return [
|
||||
@@ -21,6 +26,11 @@ final class CoreLibsSecurityPasswordTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: we need different hash types for PHP versions
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function passwordRehashProvider(): array
|
||||
{
|
||||
return [
|
||||
@@ -63,6 +73,10 @@ final class CoreLibsSecurityPasswordTest extends TestCase
|
||||
*/
|
||||
public function testPasswordRehashCheck(string $input, bool $expected): void
|
||||
{
|
||||
// in PHP 8.4 the length is $12
|
||||
if (PHP_VERSION_ID > 80400) {
|
||||
$input = str_replace('$2y$10$', '$2y$12$', $input);
|
||||
}
|
||||
$this->assertEquals(
|
||||
$expected,
|
||||
\CoreLibs\Security\Password::passwordRehashCheck($input)
|
||||
|
||||
Reference in New Issue
Block a user