summaryrefslogtreecommitdiff
path: root/vendor/ircmaxell/password-compat/test/Unit/PasswordGetInfoTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ircmaxell/password-compat/test/Unit/PasswordGetInfoTest.php')
-rw-r--r--vendor/ircmaxell/password-compat/test/Unit/PasswordGetInfoTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/ircmaxell/password-compat/test/Unit/PasswordGetInfoTest.php b/vendor/ircmaxell/password-compat/test/Unit/PasswordGetInfoTest.php
new file mode 100644
index 00000000..6aab976a
--- /dev/null
+++ b/vendor/ircmaxell/password-compat/test/Unit/PasswordGetInfoTest.php
@@ -0,0 +1,26 @@
+<?php
+
+class PasswordGetInfoTest extends PHPUnit_Framework_TestCase {
+
+ public static function provideInfo() {
+ return array(
+ array('foo', array('algo' => 0, 'algoName' => 'unknown', 'options' => array())),
+ array('$2y$', array('algo' => 0, 'algoName' => 'unknown', 'options' => array())),
+ array('$2y$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi', array('algo' => PASSWORD_BCRYPT, 'algoName' => 'bcrypt', 'options' => array('cost' => 7))),
+ array('$2y$10$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi', array('algo' => PASSWORD_BCRYPT, 'algoName' => 'bcrypt', 'options' => array('cost' => 10))),
+
+ );
+ }
+
+ public function testFuncExists() {
+ $this->assertTrue(function_exists('password_get_info'));
+ }
+
+ /**
+ * @dataProvider provideInfo
+ */
+ public function testInfo($hash, $info) {
+ $this->assertEquals($info, password_get_info($hash));
+ }
+
+} \ No newline at end of file