namespace Symfony\Component\PasswordHasher\Tests\Hasher;
use PHPUnit\Framework\TestCase;
use Symfony\Component\PasswordHasher\Exception\InvalidPasswordException;
use Symfony\Component\PasswordHasher\Hasher\MessageDigestPasswordHasher;
class MessageDigestPasswordHasherTest extends TestCase
{ public function testVerify() { $hasher =
new MessageDigestPasswordHasher('sha256', false, 1
);
$this->
assertTrue($hasher->
verify(hash('sha256', 'password'
), 'password', ''
));
} public function testHash() { $hasher =
new MessageDigestPasswordHasher('sha256', false, 1
);
$this->
assertSame(hash('sha256', 'password'
),
$hasher->
hash('password', ''
));
$hasher =
new MessageDigestPasswordHasher('sha256', true, 1
);
$this->
assertSame(base64_encode(hash('sha256', 'password', true
)),
$hasher->
hash('password', ''
));