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-11-08 15:48:01 +00:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2016-08-14 04:08:43 +00:00
|
|
|
|
2017-11-08 15:48:01 +00:00
|
|
|
class PasswordHasherTest extends TestCase
|
2012-08-03 20:21:32 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @dataProvider providerHashPassword
|
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);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
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
|
|
|
}
|