Test getPasswordHash() methods

This commit is contained in:
Marcin Łojewski
2018-07-02 21:10:27 +02:00
parent 89598a5b36
commit 6a01cff095
20 changed files with 120 additions and 0 deletions

View File

@@ -43,6 +43,12 @@ class CleartextTest extends TestCase
$this->assertTrue($this->crypto->checkPassword("password", "password")); $this->assertTrue($this->crypto->checkPassword("password", "password"));
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -47,6 +47,12 @@ class CourierMD5RawTest extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -47,6 +47,12 @@ class CourierMD5Test extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -47,6 +47,12 @@ class CourierSHA1Test extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -48,6 +48,12 @@ class CourierSHA256Test extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -48,6 +48,12 @@ class CryptArgon2Test extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -48,6 +48,12 @@ class CryptBlowfishTest extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -45,6 +45,12 @@ class CryptExtendedDESTest extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -47,6 +47,12 @@ class CryptMD5Test extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -48,6 +48,12 @@ class CryptSHA256Test extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -48,6 +48,12 @@ class CryptSHA512Test extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -45,6 +45,12 @@ class CryptStandardDESTest extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -48,6 +48,12 @@ class CryptTest extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -48,6 +48,12 @@ class JoomlaTest extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -47,6 +47,12 @@ class MD5Test extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -47,6 +47,12 @@ class PhpassTest extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -47,6 +47,12 @@ class SHA1Test extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -48,6 +48,12 @@ class SHA512WhirlpoolTest extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -48,6 +48,12 @@ class SSHA256Test extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();

View File

@@ -48,6 +48,12 @@ class SSHA512Test extends TestCase
); );
} }
public function testPasswordHash()
{
$hash = $this->crypto->getPasswordHash("password");
$this->assertTrue($this->crypto->checkPassword("password", $hash));
}
protected function setUp() protected function setUp()
{ {
parent::setUp(); parent::setUp();