Commit c04fa0c0 authored by Marc Egger's avatar Marc Egger
Browse files

PasswordTest.php: Add test of password hashing and checking

parent a7495dae
Pipeline #1498 failed with stage
in 2 minutes and 2 seconds
......@@ -7,6 +7,7 @@
*/
// use autoloader of composer. Directories for autoload specified in composer.json -> autoload
// run 'composer dump-autoload' after making changes to composer.json -> autoload !
require_once(__DIR__ . '/../vendor/autoload.php');
require_once(__DIR__ . '/core/Constants.php');
\ No newline at end of file
......@@ -392,8 +392,7 @@ class Evaluate {
case TOKEN_ESCAPE_NONE: // do nothing
break;
case TOKEN_ESCAPE_PASSWORD_T3FE:
$fePassword = new Password();
$value = $fePassword->getHash($value);
$value = Password::getHash($value);
break;
default:
throw new UserFormException("Unknown escape qualifier: $escape", UNKNOWN_TYPE);
......
<?php
/**
* Created by PhpStorm.
* User: crose
* Date: 11/02/18
* Time: 9:16 PM
*/
namespace qfq;
use PHPUnit\Framework\TestCase;
/**
* Class PasswordTest
* @package qfq
*/
class PasswordTest extends TestCase {
public function testPasswordHashAndCheck() {
$pw='crazysecurepassword23465-.';
$pwSalted=Password::getHash($pw);
$this->assertTrue(Password::checkPassword($pwSalted, $pw));
}
}
\ No newline at end of file
......@@ -16,7 +16,8 @@
"Source/core/form/",
"Source/core/helper/",
"Source/core/report/",
"Source/core/store/"]
"Source/core/store/",
"Source/core/typo3/"]
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment