Kanboard now requires PHP >= 7.2 since other versions are deprecated

This commit is contained in:
Timo
2020-01-14 21:02:31 +01:00
committed by Frédéric Guillot
parent 7731dde413
commit 64397f45fa
39 changed files with 520 additions and 363 deletions

View File

@@ -20,13 +20,13 @@ class HostValidatorTest extends PHPUnit_Framework_TestCase
{
$this->assertNull(HostValidator::validate(array('192.168.10.1/24'), '192.168.10.1'),'test ip match');
$this->assertNull(HostValidator::validate(array('192.168.10.1/24'), '192.168.10.250'),'test ip match');
$this->setExpectedException('\JsonRPC\Exception\AccessDeniedException');
$this->expectException('\JsonRPC\Exception\AccessDeniedException');
HostValidator::validate(array('192.168.10.1/24'), '192.168.11.1');
}
public function testWithNotAuthorizedHosts()
{
$this->setExpectedException('\JsonRPC\Exception\AccessDeniedException');
$this->expectException('\JsonRPC\Exception\AccessDeniedException');
HostValidator::validate(array('192.168.1.1'), '127.0.0.1', '127.0.0.1');
}
}

View File

@@ -16,7 +16,7 @@ class JsonEncodingValidatorTest extends PHPUnit_Framework_TestCase
{
json_encode("\xB1\x31");
$this->setExpectedException('\JsonRPC\Exception\ResponseEncodingFailureException');
$this->expectException('\JsonRPC\Exception\ResponseEncodingFailureException');
JsonEncodingValidator::validate();
}
}

View File

@@ -13,7 +13,7 @@ class JsonFormatValidatorTest extends PHPUnit_Framework_TestCase
public function testJsonNotParsedCorrectly()
{
$this->setExpectedException('\JsonRPC\Exception\InvalidJsonFormatException');
$this->expectException('\JsonRPC\Exception\InvalidJsonFormatException');
JsonFormatValidator::validate('');
}
}

View File

@@ -13,31 +13,31 @@ class RpcFormatValidatorTest extends PHPUnit_Framework_TestCase
public function testWithNoVersion()
{
$this->setExpectedException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
$this->expectException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
RpcFormatValidator::validate(array('method' => 'foobar'));
}
public function testWithNoMethod()
{
$this->setExpectedException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
$this->expectException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
RpcFormatValidator::validate(array('jsonrpc' => '2.0'));
}
public function testWithMethodNotString()
{
$this->setExpectedException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
$this->expectException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
RpcFormatValidator::validate(array('jsonrpc' => '2.0', 'method' => array()));
}
public function testWithBadVersion()
{
$this->setExpectedException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
$this->expectException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
RpcFormatValidator::validate(array('jsonrpc' => '1.0', 'method' => 'abc'));
}
public function testWithBadParams()
{
$this->setExpectedException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
$this->expectException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
RpcFormatValidator::validate(array('jsonrpc' => '2.0', 'method' => 'abc', 'params' => 'foobar'));
}

View File

@@ -18,7 +18,7 @@ class UserValidatorTest extends PHPUnit_Framework_TestCase
public function testWithNotAuthorizedHosts()
{
$this->setExpectedException('\JsonRPC\Exception\AuthenticationFailureException');
$this->expectException('\JsonRPC\Exception\AuthenticationFailureException');
UserValidator::validate(array('user' => 'pass'), 'user', 'wrong password');
}
}