mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Update composer.json for PHP 7.2
This commit is contained in:
parent
35a93f3928
commit
e79493bda5
549 changed files with 21493 additions and 24634 deletions
52
vendor/bordoni/phpass/Tests/BasicTest.php
vendored
Normal file
52
vendor/bordoni/phpass/Tests/BasicTest.php
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
// namespace Hautelook\Phpass\Tests;
|
||||
|
||||
use Hautelook\Phpass\PasswordHash;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class BasicTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
const PORTABLE_HASH = '$P$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0';
|
||||
public function testCorrectHash()
|
||||
{
|
||||
$hasher = new PasswordHash(8,false);
|
||||
$correct = 'test12345';
|
||||
$hash = $hasher->HashPassword($correct);
|
||||
|
||||
$this->assertTrue($hasher->CheckPassword($correct, $hash));
|
||||
}
|
||||
|
||||
public function testIncorrectHash()
|
||||
{
|
||||
$hasher = new PasswordHash(8,false);
|
||||
$correct = 'test12345';
|
||||
$hash = $hasher->HashPassword($correct);
|
||||
$wrong = 'test12346';
|
||||
|
||||
$this->assertFalse($hasher->CheckPassword($wrong, $hash));
|
||||
}
|
||||
|
||||
public function testWeakHashes()
|
||||
{
|
||||
$hasher = new PasswordHash(8, true);
|
||||
$correct = 'test12345';
|
||||
$hash = $hasher->HashPassword($correct);
|
||||
$wrong = 'test12346';
|
||||
|
||||
$this->assertTrue($hasher->CheckPassword($correct, $hash));
|
||||
$this->assertFalse($hasher->CheckPassword($wrong, $hash));
|
||||
}
|
||||
|
||||
public function testPortableHashes()
|
||||
{
|
||||
$hasher = new PasswordHash(8, true);
|
||||
$correct = 'test12345';
|
||||
$wrong = 'test12346';
|
||||
|
||||
$this->assertTrue($hasher->CheckPassword($correct, self::PORTABLE_HASH));
|
||||
$this->assertFalse($hasher->CheckPassword($wrong, self::PORTABLE_HASH));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue