0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

better test coverage - make sure pacrypt() respects php_crypt:MD5 and makes something like $1$.....

This commit is contained in:
David Goodwin 2023-03-09 21:57:58 +00:00
parent a5ec516adc
commit 605a019a24

View File

@ -110,9 +110,18 @@ class PaCryptTest extends \PHPUnit\Framework\TestCase
public function testPhpCryptMd5()
{
global $CONF;
$config = Config::getInstance();
Config::write('encrypt', 'php_crypt:MD5');
$CONF['encrypt'] = 'php_crypt:MD5';
$new = _pacrypt_php_crypt('foo', '');
$pac = pacrypt('foo', '');
$this->assertEquals(1, preg_match('!^\$1\$!', $new), $new);
$this->assertEquals(1, preg_match('!^\$1\$!', $pac), $pac);
$CONF = Config::getInstance()->getAll();