diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
commit | 19985dbb8c0aa66dc4bf7905abc1148de909097d (patch) | |
tree | 2cd5a5d20d7e80fc2a51adf60d838d8a2c40999e /admin/survey/minify/vendor/intervention/httpauth/tests/HttpauthTest.php | |
download | 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.gz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.bz2 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.lz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.xz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.zst 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.zip |
Diffstat (limited to 'admin/survey/minify/vendor/intervention/httpauth/tests/HttpauthTest.php')
-rw-r--r-- | admin/survey/minify/vendor/intervention/httpauth/tests/HttpauthTest.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/admin/survey/minify/vendor/intervention/httpauth/tests/HttpauthTest.php b/admin/survey/minify/vendor/intervention/httpauth/tests/HttpauthTest.php new file mode 100644 index 0000000..88230d5 --- /dev/null +++ b/admin/survey/minify/vendor/intervention/httpauth/tests/HttpauthTest.php @@ -0,0 +1,49 @@ +<?php
+
+use Intervention\Httpauth\Httpauth;
+
+class HttpauthTest extends PHPUnit_Framework_TestCase
+{
+ private function createTestHttpauth()
+ {
+ $config = array(
+ 'realm' => 'test_realm',
+ 'username' => 'test_user',
+ 'password' => 'test_password'
+ );
+
+ $httpauth = new Httpauth($config);
+ return $httpauth;
+ }
+
+ public function testConstruction()
+ {
+ $httpauth = $this->createTestHttpauth();
+ $this->assertInstanceOf('\Intervention\Httpauth\Httpauth', $httpauth);
+ $this->assertEquals('test_realm', $httpauth->realm);
+ $this->assertTrue($httpauth->isValid('test_user', 'test_password'));
+ }
+
+ public function testStaticCall()
+ {
+ $config = array(
+ 'realm' => '1',
+ 'username' => '2',
+ 'password' => '3'
+ );
+
+ $httpauth = Httpauth::make($config);
+
+ $this->assertInstanceOf('\Intervention\Httpauth\Httpauth', $httpauth);
+ $this->assertEquals('1', $httpauth->realm);
+ $this->assertTrue($httpauth->isValid($config['username'], $config['password']));
+ }
+
+ /**
+ * @expectedException Exception
+ */
+ public function testConstructorWithoutUserPassword()
+ {
+ $httpauth = new Httpauth;
+ }
+}
|