public function testEncodePasswordPbkdf2() { $this->passwordHasherCommandTester->
execute([ 'password' => 'password',
'user-class' => 'Custom\Class\Pbkdf2\User',
],
['interactive' => false
]);
$output =
$this->passwordHasherCommandTester->
getDisplay();
$this->
assertStringContainsString('Password hashing succeeded',
$output);
$hasher =
new Pbkdf2PasswordHasher('sha512', true, 1000
);
preg_match('# Password hash\s{1,}([\w+\/]+={0,2})\s+#',
$output,
$matches);
$hash =
$matches[1
];
preg_match('# Generated salt\s{1,}([\w+\/]+={0,2})\s+#',
$output,
$matches);
$salt =
$matches[1
];
$this->
assertTrue($hasher->
verify($hash, 'password',
$salt));
} public function testEncodePasswordOutput() { $this->passwordHasherCommandTester->
execute( [