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

2
.gitignore vendored
View File

@ -21,4 +21,4 @@ data/config.php
*.bak
/config.php
!docker/var/wwww/app/config.php
node_modules
node_modules

View File

@ -11,9 +11,9 @@ language: php
sudo: false
php:
- 7.4
- 7.3
- 7.2
- 5.6
env:
- DB=sqlite
@ -22,8 +22,8 @@ env:
matrix:
fast_finish: true
before_install:
- composer install
before_script:
- composer install --no-interaction
- npm install -g jshint
script:

View File

@ -223,7 +223,7 @@ class UserSession extends Base
public function getFilters($projectID)
{
if (! session_exists('filters:'.$projectID)) {
return session_get('user')['filter'] ?: 'status:open';
return session_get('user') ? session_get('user')['filter'] ?: 'status:open' : 'status:open';
}
return session_get('filters:'.$projectID);

View File

@ -1,8 +1,8 @@
<?php
// PHP 5.6.0 minimum
if (version_compare(PHP_VERSION, '5.6.0', '<')) {
throw new Exception('This software requires PHP 5.6.0 minimum');
// PHP 7.2.0 minimum
if (version_compare(PHP_VERSION, '7.2.0', '<')) {
throw new Exception('This software requires PHP 7.2.0 minimum');
}
// Check data folder if sqlite

View File

@ -14,7 +14,7 @@
"discard-changes": true
},
"require" : {
"php" : ">=5.6.0",
"php" : ">=7.2.0",
"ext-simplexml" : "*",
"ext-dom" : "*",
"ext-xml" : "*",
@ -50,17 +50,17 @@
]
},
"require-dev" : {
"phpunit/php-code-coverage": "4.0.8",
"phpunit/php-token-stream": "1.4.12",
"doctrine/instantiator": "1.0.5",
"phpunit/php-code-coverage": "^6",
"phpunit/php-token-stream": "^3.1",
"doctrine/instantiator": "^1.1",
"phpdocumentor/reflection-docblock": "3.3.2",
"symfony/debug": "3.4.2",
"symfony/yaml": "3.4.2",
"symfony/finder": "3.4.8",
"symfony/stopwatch" : "3.4.2",
"myclabs/deep-copy": "1.7.0",
"phpunit/phpunit" : "5.7.24",
"phpunit/phpunit-selenium": "3.0.3",
"phpunit/phpunit" : "^7",
"phpunit/phpunit-selenium": "^7",
"roave/security-advisories": "dev-master"
}
}

660
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -77,7 +77,7 @@ class ClientTest extends PHPUnit_Framework_TestCase
),
)));
$this->setExpectedException('BadFunctionCallException');
$this->expectException('BadFunctionCallException');
$client->execute('methodA', array('a' => 'b'));
}

View File

@ -64,7 +64,7 @@ class HttpClientTest extends \PHPUnit_Framework_TestCase
public function testWithServerError()
{
$this->setExpectedException('\JsonRPC\Exception\ServerErrorException');
$this->expectException('\JsonRPC\Exception\ServerErrorException');
$httpClient = new HttpClient();
$httpClient->handleExceptions(array(
@ -76,7 +76,7 @@ class HttpClientTest extends \PHPUnit_Framework_TestCase
public function testWithConnectionFailure()
{
$this->setExpectedException('\JsonRPC\Exception\ConnectionFailureException');
$this->expectException('\JsonRPC\Exception\ConnectionFailureException');
$httpClient = new HttpClient();
$httpClient->handleExceptions(array(
@ -86,7 +86,7 @@ class HttpClientTest extends \PHPUnit_Framework_TestCase
public function testWithAccessForbidden()
{
$this->setExpectedException('\JsonRPC\Exception\AccessDeniedException');
$this->expectException('\JsonRPC\Exception\AccessDeniedException');
$httpClient = new HttpClient();
$httpClient->handleExceptions(array(
@ -96,7 +96,7 @@ class HttpClientTest extends \PHPUnit_Framework_TestCase
public function testWithAccessNotAllowed()
{
$this->setExpectedException('\JsonRPC\Exception\AccessDeniedException');
$this->expectException('\JsonRPC\Exception\AccessDeniedException');
$httpClient = new HttpClient();
$httpClient->handleExceptions(array(
@ -149,7 +149,7 @@ class HttpClientTest extends \PHPUnit_Framework_TestCase
$client->withHeaders(array('Content-Length: '.strlen($payload)));
});
$this->setExpectedException('\JsonRPC\Exception\ConnectionFailureException');
$this->expectException('\JsonRPC\Exception\ConnectionFailureException');
$httpClient->execute('test');
}
@ -214,7 +214,7 @@ class HttpClientTest extends \PHPUnit_Framework_TestCase
});
$this->setExpectedException('\JsonRPC\Exception\ConnectionFailureException');
$this->expectException('\JsonRPC\Exception\ConnectionFailureException');
$httpClient->execute('test');
}
}

View File

@ -27,7 +27,7 @@ class MiddlewareHandlerTest extends PHPUnit_Framework_TestCase
{
public function testMiddlewareCanRaiseException()
{
$this->setExpectedException('JsonRpc\Exception\AuthenticationFailureException');
$this->expectException('JsonRpc\Exception\AuthenticationFailureException');
$middlewareHandler = new MiddlewareHandler();
$middlewareHandler->withUsername('myUsername');

View File

@ -39,14 +39,14 @@ class ProcedureHandlerTest extends PHPUnit_Framework_TestCase
{
public function testProcedureNotFound()
{
$this->setExpectedException('BadFunctionCallException');
$this->expectException('BadFunctionCallException');
$handler = new ProcedureHandler;
$handler->executeProcedure('a');
}
public function testCallbackNotFound()
{
$this->setExpectedException('BadFunctionCallException');
$this->expectException('BadFunctionCallException');
$handler = new ProcedureHandler;
$handler->withCallback('b', function() {});
$handler->executeProcedure('a');
@ -54,7 +54,7 @@ class ProcedureHandlerTest extends PHPUnit_Framework_TestCase
public function testClassNotFound()
{
$this->setExpectedException('BadFunctionCallException');
$this->expectException('BadFunctionCallException');
$handler = new ProcedureHandler;
$handler->withClassAndMethod('getAllTasks', 'c', 'getAll');
$handler->executeProcedure('getAllTasks');
@ -62,7 +62,7 @@ class ProcedureHandlerTest extends PHPUnit_Framework_TestCase
public function testMethodNotFound()
{
$this->setExpectedException('BadFunctionCallException');
$this->expectException('BadFunctionCallException');
$handler = new ProcedureHandler;
$handler->withClassAndMethod('getAllTasks', 'A', 'getNothing');
$handler->executeProcedure('getAllTasks');
@ -127,7 +127,7 @@ class ProcedureHandlerTest extends PHPUnit_Framework_TestCase
public function testTooManyArguments()
{
$this->setExpectedException('InvalidArgumentException');
$this->expectException('InvalidArgumentException');
$handler = new ProcedureHandler;
$handler->withClassAndMethod('getAllC', new B, 'getAll');
@ -136,7 +136,7 @@ class ProcedureHandlerTest extends PHPUnit_Framework_TestCase
public function testNotEnoughArguments()
{
$this->setExpectedException('InvalidArgumentException');
$this->expectException('InvalidArgumentException');
$handler = new ProcedureHandler;
$handler->withClassAndMethod('getAllC', new B, 'getAll');

View File

@ -17,7 +17,7 @@ class ResponseParserTest extends PHPUnit_Framework_TestCase
public function testWithBadJsonFormat()
{
$this->setExpectedException('\JsonRPC\Exception\InvalidJsonFormatException');
$this->expectException('\JsonRPC\Exception\InvalidJsonFormatException');
ResponseParser::create()
->withPayload('foobar')
@ -26,7 +26,7 @@ class ResponseParserTest extends PHPUnit_Framework_TestCase
public function testWithBadProcedure()
{
$this->setExpectedException('BadFunctionCallException');
$this->expectException('BadFunctionCallException');
ResponseParser::create()
->withPayload(json_decode('{"jsonrpc": "2.0", "error": {"code": -32601, "message": "Method not found"}, "id": "1"}', true))
@ -35,7 +35,7 @@ class ResponseParserTest extends PHPUnit_Framework_TestCase
public function testWithInvalidArgs()
{
$this->setExpectedException('InvalidArgumentException');
$this->expectException('InvalidArgumentException');
ResponseParser::create()
->withPayload(json_decode('{"jsonrpc": "2.0", "error": {"code": -32602, "message": "Invalid params"}, "id": "1"}', true))
@ -44,7 +44,7 @@ class ResponseParserTest extends PHPUnit_Framework_TestCase
public function testWithInvalidRequest()
{
$this->setExpectedException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
$this->expectException('\JsonRPC\Exception\InvalidJsonRpcFormatException');
ResponseParser::create()
->withPayload(json_decode('{"jsonrpc": "2.0", "error": {"code": -32600, "message": "Invalid Request"}, "id": null}', true))
@ -53,7 +53,7 @@ class ResponseParserTest extends PHPUnit_Framework_TestCase
public function testWithParseError()
{
$this->setExpectedException('\JsonRPC\Exception\InvalidJsonFormatException');
$this->expectException('\JsonRPC\Exception\InvalidJsonFormatException');
ResponseParser::create()
->withPayload(json_decode('{"jsonrpc": "2.0", "error": {"code": -32700, "message": "Parse error"}, "id": null}', true))
@ -62,7 +62,7 @@ class ResponseParserTest extends PHPUnit_Framework_TestCase
public function testWithOtherError()
{
$this->setExpectedException('\JsonRPC\Exception\ResponseException');
$this->expectException('\JsonRPC\Exception\ResponseException');
ResponseParser::create()
->withPayload(json_decode('{"jsonrpc": "2.0", "error": {"code": 42, "message": "Something", "data": "foobar"}, "id": null}', true))
@ -91,7 +91,7 @@ class ResponseParserTest extends PHPUnit_Framework_TestCase
{"jsonrpc": "2.0", "error": {"code": -32602, "message": "Invalid params"}, "id": "1"}
]';
$this->setExpectedException('InvalidArgumentException');
$this->expectException('InvalidArgumentException');
ResponseParser::create()
->withPayload(json_decode($payload, true))

View File

@ -222,7 +222,7 @@ class ServerTest extends HeaderMockTest
throw new MyException('test');
});
$this->setExpectedException('MyException');
$this->expectException('MyException');
$server->execute();
}

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');
}
}

View File

@ -1,6 +1,6 @@
<?php
class DefaultConfigFileTest extends PHPUnit_Framework_TestCase
class DefaultConfigFileTest extends PHPUnit\Framework\TestCase
{
public function testThatFileCanBeImported()
{

View File

@ -6,25 +6,25 @@ class ProcedureAuthorizationTest extends BaseProcedureTest
{
public function testApiCredentialDoNotHaveAccessToUserCredentialProcedure()
{
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->app->getMe();
}
public function testUserCredentialDoNotHaveAccessToAdminProcedures()
{
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->getUser(1);
}
public function testManagerCredentialDoNotHaveAccessToAdminProcedures()
{
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->getAllProjects();
}
public function testUserCredentialDoNotHaveAccessToManagerProcedures()
{
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->createProject('Team project creation are only for app managers');
}
@ -38,7 +38,7 @@ class ProcedureAuthorizationTest extends BaseProcedureTest
$projectId = $this->admin->createProject('Team project created by admin');
$this->assertNotFalse($projectId);
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->assertNotNull($this->manager->getProjectById($projectId));
}
@ -61,7 +61,7 @@ class ProcedureAuthorizationTest extends BaseProcedureTest
$projectId = $this->manager->createProject('A team project without members');
$this->assertNotFalse($projectId);
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->getProjectById($projectId);
}
@ -90,7 +90,7 @@ class ProcedureAuthorizationTest extends BaseProcedureTest
$actionId = $this->manager->createAction($projectId, 'task.move.column', '\Kanboard\Action\TaskCloseColumn', array('column_id' => 1));
$this->assertNotFalse($actionId);
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->removeAction($projectId);
}
@ -108,7 +108,7 @@ class ProcedureAuthorizationTest extends BaseProcedureTest
$this->assertTrue($this->manager->addProjectUser($projectId, $this->userUserId, 'project-member'));
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->removeAction($actionId);
}
@ -140,7 +140,7 @@ class ProcedureAuthorizationTest extends BaseProcedureTest
$categoryId = $this->manager->createCategory($projectId, 'Test');
$this->assertNotFalse($categoryId);
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->removeCategory($categoryId);
}
@ -157,7 +157,7 @@ class ProcedureAuthorizationTest extends BaseProcedureTest
$this->assertNotFalse($categoryId);
$this->assertTrue($this->manager->addProjectUser($projectId, $this->userUserId, 'project-member'));
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->removeCategory($categoryId);
}
@ -189,7 +189,7 @@ class ProcedureAuthorizationTest extends BaseProcedureTest
$columnId = $this->manager->addColumn($projectId, 'Test');
$this->assertNotFalse($columnId);
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->removeColumn($columnId);
}
@ -206,7 +206,7 @@ class ProcedureAuthorizationTest extends BaseProcedureTest
$this->assertNotFalse($columnId);
$this->assertTrue($this->manager->addProjectUser($projectId, $this->userUserId, 'project-member'));
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->removeColumn($columnId);
}
@ -242,7 +242,7 @@ class ProcedureAuthorizationTest extends BaseProcedureTest
$commentId = $this->manager->createComment($taskId, $this->userUserId, 'My comment');
$this->assertNotFalse($commentId);
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->updateComment($commentId, 'something else');
}
@ -281,7 +281,7 @@ class ProcedureAuthorizationTest extends BaseProcedureTest
$subtaskId = $this->manager->createSubtask($taskId, 'My subtask');
$this->assertNotFalse($subtaskId);
$this->setExpectedException('JsonRPC\Exception\AccessDeniedException');
$this->expectException('JsonRPC\Exception\AccessDeniedException');
$this->user->removeSubtask($subtaskId);
}

View File

@ -11,7 +11,7 @@ use Kanboard\Core\Log\Logger;
use Kanboard\Core\Session\FlashMessage;
use Kanboard\ServiceProvider\ActionProvider;
abstract class Base extends PHPUnit_Framework_TestCase
abstract class Base extends PHPUnit\Framework\TestCase
{
protected $container;

View File

@ -26,7 +26,7 @@ class ActionManagerTest extends Base
public function testGetActionNotFound()
{
$this->setExpectedException('RuntimeException', 'Automatic Action Not Found: foobar');
$this->expectException('RuntimeException', 'Automatic Action Not Found: foobar');
$actionManager = new ActionManager($this->container);
$actionManager->getAction('foobar');
}

View File

@ -25,7 +25,7 @@ class ExternalLinkManagerTest extends Base
{
$externalLinkManager = new ExternalLinkManager($this->container);
$this->setExpectedException('\Kanboard\Core\ExternalLink\ExternalLinkProviderNotFound');
$this->expectException('\Kanboard\Core\ExternalLink\ExternalLinkProviderNotFound');
$externalLinkManager->getProvider('not found');
}
@ -68,7 +68,7 @@ class ExternalLinkManagerTest extends Base
$externalLinkManager->register($webLinkProvider);
$externalLinkManager->register($attachmentLinkProvider);
$this->setExpectedException('\Kanboard\Core\ExternalLink\ExternalLinkProviderNotFound');
$this->expectException('\Kanboard\Core\ExternalLink\ExternalLinkProviderNotFound');
$externalLinkManager->find();
}
@ -113,7 +113,7 @@ class ExternalLinkManagerTest extends Base
$externalLinkManager->register($webLinkProvider);
$externalLinkManager->register($attachmentLinkProvider);
$this->setExpectedException('\Kanboard\Core\ExternalLink\ExternalLinkProviderNotFound');
$this->expectException('\Kanboard\Core\ExternalLink\ExternalLinkProviderNotFound');
$externalLinkManager->setUserInput(array('text' => 'https://google.com/', 'type' => 'not found'));
$externalLinkManager->find();
}

View File

@ -8,7 +8,7 @@ class ExternalTaskManagerTest extends Base
{
public function testProviderNotFound()
{
$this->setExpectedException('Kanboard\Core\ExternalTask\ProviderNotFoundException');
$this->expectException('Kanboard\Core\ExternalTask\ProviderNotFoundException');
$manager = new ExternalTaskManager();
$manager->getProvider('foobar');

View File

@ -68,7 +68,7 @@ class ClientTest extends \Base
public function testGetLdapServerNotConfigured()
{
$this->setExpectedException('\LogicException');
$this->expectException('\LogicException');
$ldap = new Client;
$ldap->getLdapServer();
}
@ -100,7 +100,7 @@ class ClientTest extends \Base
)
->will($this->returnValue(false));
$this->setExpectedException('\Kanboard\Core\Ldap\ConnectionException');
$this->expectException('\Kanboard\Core\Ldap\ConnectionException');
$ldap = new Client;
$ldap->open('my_ldap_server');
@ -150,7 +150,7 @@ class ClientTest extends \Base
)
->will($this->returnValue(false));
$this->setExpectedException('\Kanboard\Core\Ldap\ConnectionException');
$this->expectException('\Kanboard\Core\Ldap\ConnectionException');
$ldap = new Client;
$ldap->open('my_ldap_server', 389, true);
@ -175,7 +175,7 @@ class ClientTest extends \Base
->method('ldap_bind')
->will($this->returnValue(false));
$this->setExpectedException('\Kanboard\Core\Ldap\ClientException');
$this->expectException('\Kanboard\Core\Ldap\ClientException');
$ldap = new Client;
$ldap->useAnonymousAuthentication();
@ -228,7 +228,7 @@ class ClientTest extends \Base
)
->will($this->returnValue(false));
$this->setExpectedException('\Kanboard\Core\Ldap\ClientException');
$this->expectException('\Kanboard\Core\Ldap\ClientException');
$ldap = new Client;
$ldap->open('my_ldap_server');

View File

@ -151,7 +151,7 @@ class LdapGroupTest extends Base
public function testGetBaseDnNotConfigured()
{
$this->setExpectedException('\LogicException');
$this->expectException('\LogicException');
$group = new Group($this->query);
$group->getBasDn();

View File

@ -787,7 +787,7 @@ class LdapUserTest extends Base
public function testGetBaseDnNotConfigured()
{
$this->setExpectedException('\LogicException');
$this->expectException('\LogicException');
$user = new User($this->query);
$user->getBasDn();
@ -795,7 +795,7 @@ class LdapUserTest extends Base
public function testGetLdapUserPatternNotConfigured()
{
$this->setExpectedException('\LogicException');
$this->expectException('\LogicException');
$user = new User($this->query);
$user->getLdapUserPattern('test');

View File

@ -22,14 +22,14 @@ class AuthenticationManagerTest extends Base
public function testGetProviderNotFound()
{
$authManager = new AuthenticationManager($this->container);
$this->setExpectedException('LogicException');
$this->expectException('LogicException');
$authManager->getProvider('Dababase');
}
public function testGetPostProviderNotFound()
{
$authManager = new AuthenticationManager($this->container);
$this->setExpectedException('LogicException');
$this->expectException('LogicException');
$authManager->getPostAuthenticationProvider();
}

View File

@ -8,7 +8,7 @@ class LdapBackendGroupProviderTest extends Base
{
public function testGetLdapGroupPattern()
{
$this->setExpectedException('LogicException', 'LDAP group filter empty, check the parameter LDAP_GROUP_FILTER');
$this->expectException('LogicException', 'LDAP group filter empty, check the parameter LDAP_GROUP_FILTER');
$backend = new LdapBackendGroupProvider($this->container);
$backend->getLdapGroupPattern('test');

View File

@ -45,7 +45,7 @@ class ApplicationAuthorizationMiddlewareMiddlewareTest extends Base
->expects($this->never())
->method('execute');
$this->setExpectedException('Kanboard\Core\Controller\AccessForbiddenException');
$this->expectException('Kanboard\Core\Controller\AccessForbiddenException');
$this->middleware->execute();
}

View File

@ -56,7 +56,7 @@ class ProjectAuthorizationMiddlewareMiddlewareTest extends Base
->expects($this->never())
->method('execute');
$this->setExpectedException('Kanboard\Core\Controller\AccessForbiddenException');
$this->expectException('Kanboard\Core\Controller\AccessForbiddenException');
$this->middleware->execute();
}

View File

@ -388,10 +388,10 @@ class UserModelTest extends Base
$projectModel = new ProjectModel($this->container);
$this->assertEquals(2, $userModel->create(array('username' => 'toto', 'password' => '123456', 'name' => 'Toto')));
$this->assertEquals(1, $projectModel->create(array('name' => 'Project #1', 'is_private' => 1, 'owner_id' => 2)));
$this->assertEquals(1, $projectModel->create(array('name' => 'Project #1', 'is_private' => 1), 2));
$this->assertTrue($userModel->disable(2));
$project = $projectModel->getById(2);
$project = $projectModel->getById(1);
$this->assertEquals(0, $project['is_active']);
}
}

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitbdc3716ceecc7570f8ff9a8407f0ca0e::getLoader();
return ComposerAutoloaderInit094f3eabe2924332bc2198a9ba245f27::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitbdc3716ceecc7570f8ff9a8407f0ca0e
class ComposerAutoloaderInit094f3eabe2924332bc2198a9ba245f27
{
private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInitbdc3716ceecc7570f8ff9a8407f0ca0e
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitbdc3716ceecc7570f8ff9a8407f0ca0e', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit094f3eabe2924332bc2198a9ba245f27', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitbdc3716ceecc7570f8ff9a8407f0ca0e', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit094f3eabe2924332bc2198a9ba245f27', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit094f3eabe2924332bc2198a9ba245f27::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@ -48,19 +48,19 @@ class ComposerAutoloaderInitbdc3716ceecc7570f8ff9a8407f0ca0e
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit094f3eabe2924332bc2198a9ba245f27::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirebdc3716ceecc7570f8ff9a8407f0ca0e($fileIdentifier, $file);
composerRequire094f3eabe2924332bc2198a9ba245f27($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequirebdc3716ceecc7570f8ff9a8407f0ca0e($fileIdentifier, $file)
function composerRequire094f3eabe2924332bc2198a9ba245f27($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e
class ComposerStaticInit094f3eabe2924332bc2198a9ba245f27
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -1082,11 +1082,11 @@ class ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::$prefixesPsr0;
$loader->fallbackDirsPsr0 = ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::$fallbackDirsPsr0;
$loader->classMap = ComposerStaticInitbdc3716ceecc7570f8ff9a8407f0ca0e::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit094f3eabe2924332bc2198a9ba245f27::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit094f3eabe2924332bc2198a9ba245f27::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInit094f3eabe2924332bc2198a9ba245f27::$prefixesPsr0;
$loader->fallbackDirsPsr0 = ComposerStaticInit094f3eabe2924332bc2198a9ba245f27::$fallbackDirsPsr0;
$loader->classMap = ComposerStaticInit094f3eabe2924332bc2198a9ba245f27::$classMap;
}, null, ClassLoader::class);
}

View File

@ -772,17 +772,17 @@
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.12.0",
"version_normalized": "1.12.0.0",
"version": "v1.13.1",
"version_normalized": "1.13.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17"
"reference": "7b4aab9743c30be783b73de055d24a39cf4b954f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17",
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f",
"reference": "7b4aab9743c30be783b73de055d24a39cf4b954f",
"shasum": ""
},
"require": {
@ -791,11 +791,11 @@
"suggest": {
"ext-mbstring": "For best performance"
},
"time": "2019-08-06T08:03:45+00:00",
"time": "2019-11-27T14:18:11+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
"dev-master": "1.13-dev"
}
},
"installation-source": "dist",

0
vendor/paragonie/random_compat/build-phar.sh vendored Executable file → Normal file
View File

View File

View File

@ -512,7 +512,9 @@ final class Mbstring
$offset = 0;
} elseif ($offset = (int) $offset) {
if ($offset < 0) {
$haystack = self::mb_substr($haystack, 0, $offset, $encoding);
if (0 > $offset += self::mb_strlen($needle)) {
$haystack = self::mb_substr($haystack, 0, $offset, $encoding);
}
$offset = 0;
} else {
$haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding);
@ -532,7 +534,7 @@ final class Mbstring
return null;
}
if ($split_length < 1) {
if (1 > $split_length = (int) $split_length) {
trigger_error('The length of each segment must be greater than zero', E_USER_WARNING);
return false;
@ -542,6 +544,10 @@ final class Mbstring
$encoding = mb_internal_encoding();
}
if ('UTF-8' === $encoding = self::getEncoding($encoding)) {
return preg_split("/(.{{$split_length}})/u", $string, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
}
$result = array();
$length = mb_strlen($string, $encoding);
@ -815,11 +821,16 @@ final class Mbstring
return self::$internalEncoding;
}
if ('UTF-8' === $encoding) {
return 'UTF-8';
}
$encoding = strtoupper($encoding);
if ('8BIT' === $encoding || 'BINARY' === $encoding) {
return 'CP850';
}
if ('UTF8' === $encoding) {
return 'UTF-8';
}

View File

@ -28,7 +28,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
"dev-master": "1.13-dev"
}
}
}