Vendoring deprecated composer libs
This commit is contained in:
24
libs/jsonrpc/tests/Validator/UserValidatorTest.php
Normal file
24
libs/jsonrpc/tests/Validator/UserValidatorTest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use JsonRPC\Validator\UserValidator;
|
||||
|
||||
require_once __DIR__.'/../../../../vendor/autoload.php';
|
||||
|
||||
class UserValidatorTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testWithEmptyHosts()
|
||||
{
|
||||
$this->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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user