2012-08-03 20:21:32 +00:00
|
|
|
<?php
|
|
|
|
|
2016-08-31 17:18:12 +00:00
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Shared;
|
2012-08-03 20:21:32 +00:00
|
|
|
|
2016-08-31 17:18:12 +00:00
|
|
|
use PhpOffice\PhpSpreadsheet\Shared\PasswordHasher;
|
2017-05-17 22:02:17 +00:00
|
|
|
use PHPUnit_Framework_TestCase;
|
2016-08-14 04:08:43 +00:00
|
|
|
|
2017-05-17 22:02:17 +00:00
|
|
|
class PasswordHasherTest extends PHPUnit_Framework_TestCase
|
2012-08-03 20:21:32 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @dataProvider providerHashPassword
|
2016-05-19 10:31:40 +00:00
|
|
|
* @group fail19
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-08-03 20:21:32 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testHashPassword($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = PasswordHasher::hashPassword(...$args);
|
2015-05-17 13:00:02 +00:00
|
|
|
$this->assertEquals($expectedResult, $result);
|
|
|
|
}
|
2012-08-03 20:21:32 +00:00
|
|
|
|
|
|
|
public function providerHashPassword()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Shared/PasswordHashes.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-08-03 20:21:32 +00:00
|
|
|
}
|