Skip to content
Snippets Groups Projects
Commit 2f0854ff authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Update tests

parent 3c3341c1
No related branches found
No related tags found
No related merge requests found
...@@ -157,6 +157,7 @@ PHP; ...@@ -157,6 +157,7 @@ PHP;
/** /**
* @covers \SimpleSAML\Utils\Crypto::pwHash * @covers \SimpleSAML\Utils\Crypto::pwHash
* @deprecated To be removed for 2.0
*/ */
public function testGoodPwHash() public function testGoodPwHash()
{ {
...@@ -174,8 +175,10 @@ PHP; ...@@ -174,8 +175,10 @@ PHP;
$this->assertEquals($expected, $res); $this->assertEquals($expected, $res);
} }
/** /**
* @covers \SimpleSAML\Utils\Crypto::pwHash * @covers \SimpleSAML\Utils\Crypto::pwHash
* @deprecated To be removed for 2.0
*/ */
public function testGoodSaltedPwHash() public function testGoodSaltedPwHash()
{ {
...@@ -196,6 +199,7 @@ PHP; ...@@ -196,6 +199,7 @@ PHP;
/** /**
* @expectedException \SimpleSAML\Error\Exception * @expectedException \SimpleSAML\Error\Exception
* @deprecated To be removed for 2.0
* *
* @covers \SimpleSAML\Utils\Crypto::pwHash * @covers \SimpleSAML\Utils\Crypto::pwHash
*/ */
...@@ -211,6 +215,21 @@ PHP; ...@@ -211,6 +215,21 @@ PHP;
* @covers \SimpleSAML\Utils\Crypto::pwValid * @covers \SimpleSAML\Utils\Crypto::pwValid
*/ */
public function testGoodPwValid() public function testGoodPwValid()
{
$pw = "password";
$hash = Crypto::pwHash($pw);
$res = Crypto::pwValid($hash, $pw);
$this->assertTrue($res);
}
/**
* @covers \SimpleSAML\Utils\Crypto::pwValid
* @deprecated To be removed for 2.0
*/
public function testGoodPwValidOld()
{ {
$pw = "password"; $pw = "password";
$algorithm = "SHA1"; $algorithm = "SHA1";
...@@ -223,6 +242,7 @@ PHP; ...@@ -223,6 +242,7 @@ PHP;
/** /**
* @covers \SimpleSAML\Utils\Crypto::pwValid * @covers \SimpleSAML\Utils\Crypto::pwValid
* @deprecated To be removed for 2.0
*/ */
public function testGoodSaltedPwValid() public function testGoodSaltedPwValid()
{ {
...@@ -238,6 +258,7 @@ PHP; ...@@ -238,6 +258,7 @@ PHP;
/** /**
* @expectedException \SimpleSAML\Error\Exception * @expectedException \SimpleSAML\Error\Exception
* @deprecated To be removed for 2.0
* *
* @covers \SimpleSAML\Utils\Crypto::pwValid * @covers \SimpleSAML\Utils\Crypto::pwValid
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment