summaryrefslogtreecommitdiffstats
path: root/admin/survey/minify/vendor/intervention/httpauth/tests/BasicUserTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/minify/vendor/intervention/httpauth/tests/BasicUserTest.php')
-rw-r--r--admin/survey/minify/vendor/intervention/httpauth/tests/BasicUserTest.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/admin/survey/minify/vendor/intervention/httpauth/tests/BasicUserTest.php b/admin/survey/minify/vendor/intervention/httpauth/tests/BasicUserTest.php
new file mode 100644
index 0000000..837a70e
--- /dev/null
+++ b/admin/survey/minify/vendor/intervention/httpauth/tests/BasicUserTest.php
@@ -0,0 +1,30 @@
+<?php
+
+use Intervention\Httpauth\BasicUser;
+
+class BasicUserTest extends PHPUnit_Framework_TestCase
+{
+ public function testBasicUserAuthMod()
+ {
+ $_SERVER['PHP_AUTH_USER'] = 'test_user';
+ $_SERVER['PHP_AUTH_PW'] = 'test_password';
+
+ $user = new BasicUser;
+ $this->assertTrue($user->isValid('test_user', 'test_password'));
+ }
+
+ public function testUserAuth()
+ {
+ $userdata = array('test_user', 'test_password');
+ $userdata = implode(':', $userdata);
+ $userdata = base64_encode($userdata);
+ $userdata = 'basic_'.$userdata;
+
+ unset($_SERVER['PHP_AUTH_USER']);
+ unset($_SERVER['PHP_AUTH_PW']);
+ $_SERVER['HTTP_AUTHENTICATION'] = $userdata;
+
+ $user = new BasicUser;
+ $this->assertTrue($user->isValid('test_user', 'test_password'));
+ }
+}