summaryrefslogtreecommitdiff
path: root/vendor/ircmaxell/password-compat/test/Unit/PasswordVerifyTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ircmaxell/password-compat/test/Unit/PasswordVerifyTest.php')
-rw-r--r--vendor/ircmaxell/password-compat/test/Unit/PasswordVerifyTest.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/vendor/ircmaxell/password-compat/test/Unit/PasswordVerifyTest.php b/vendor/ircmaxell/password-compat/test/Unit/PasswordVerifyTest.php
new file mode 100644
index 00000000..9f67bb9f
--- /dev/null
+++ b/vendor/ircmaxell/password-compat/test/Unit/PasswordVerifyTest.php
@@ -0,0 +1,29 @@
+<?php
+
+class PasswordVerifyTest extends PHPUnit_Framework_TestCase {
+
+ public function testFuncExists() {
+ $this->assertTrue(function_exists('password_verify'));
+ }
+
+ public function testFailedType() {
+ $this->assertFalse(password_verify(123, 123));
+ }
+
+ public function testSaltOnly() {
+ $this->assertFalse(password_verify('foo', '$2a$07$usesomesillystringforsalt$'));
+ }
+
+ public function testInvalidPassword() {
+ $this->assertFalse(password_verify('rasmusler', '$2a$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi'));
+ }
+
+ public function testValidPassword() {
+ $this->assertTrue(password_verify('rasmuslerdorf', '$2a$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi'));
+ }
+
+ public function testInValidHash() {
+ $this->assertFalse(password_verify('rasmuslerdorf', '$2a$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hj'));
+ }
+
+} \ No newline at end of file