From a491348d442ab8e6cd2fa403d4365cdad78e52ce Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Thu, 21 Jun 2018 14:13:41 -0700 Subject: Vendoring deprecated composer libs --- libs/jsonrpc/tests/Validator/UserValidatorTest.php | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 libs/jsonrpc/tests/Validator/UserValidatorTest.php (limited to 'libs/jsonrpc/tests/Validator/UserValidatorTest.php') diff --git a/libs/jsonrpc/tests/Validator/UserValidatorTest.php b/libs/jsonrpc/tests/Validator/UserValidatorTest.php new file mode 100644 index 00000000..e514c105 --- /dev/null +++ b/libs/jsonrpc/tests/Validator/UserValidatorTest.php @@ -0,0 +1,24 @@ +assertNull(UserValidator::validate(array(), 'user', 'pass')); + } + + public function testWithValidHosts() + { + $this->assertNull(UserValidator::validate(array('user' => 'pass'), 'user', 'pass')); + } + + public function testWithNotAuthorizedHosts() + { + $this->setExpectedException('\JsonRPC\Exception\AuthenticationFailureException'); + UserValidator::validate(array('user' => 'pass'), 'user', 'wrong password'); + } +} -- cgit v1.2.3