From 19985dbb8c0aa66dc4bf7905abc1148de909097d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Tue, 11 Jan 2022 12:35:47 +0100 Subject: prvi-commit --- .../intervention/httpauth/tests/HttpauthTest.php | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 admin/survey/minify/vendor/intervention/httpauth/tests/HttpauthTest.php (limited to 'admin/survey/minify/vendor/intervention/httpauth/tests/HttpauthTest.php') 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 @@ + '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; + } +} -- cgit v1.2.3