Update JsonRPC library

This commit is contained in:
Frederic Guillot
2016-04-26 22:55:56 -04:00
parent 36bdcf193b
commit 1936a74cb3
6 changed files with 19 additions and 19 deletions

View File

@@ -2,7 +2,7 @@
namespace Kanboard\Api; namespace Kanboard\Api;
use JsonRPC\AuthenticationFailure; use JsonRPC\Exception\AuthenticationFailureException;
/** /**
* Base class * Base class
@@ -32,7 +32,7 @@ class Auth extends Base
$this->checkProcedurePermission(false, $method); $this->checkProcedurePermission(false, $method);
} else { } else {
$this->logger->error('API authentication failure for '.$username); $this->logger->error('API authentication failure for '.$username);
throw new AuthenticationFailure('Wrong credentials'); throw new AuthenticationFailureException('Wrong credentials');
} }
} }

View File

@@ -2,7 +2,7 @@
namespace Kanboard\Api; namespace Kanboard\Api;
use JsonRPC\AccessDeniedException; use JsonRPC\Exception\AccessDeniedException;
/** /**
* Base class * Base class

View File

@@ -26,7 +26,7 @@
"christian-riesen/otp" : "1.4", "christian-riesen/otp" : "1.4",
"eluceo/ical": "0.8.0", "eluceo/ical": "0.8.0",
"erusev/parsedown" : "1.6.0", "erusev/parsedown" : "1.6.0",
"fguillot/json-rpc" : "1.0.3", "fguillot/json-rpc" : "1.1.0",
"fguillot/picodb" : "1.0.8", "fguillot/picodb" : "1.0.8",
"fguillot/simpleLogger" : "1.0.0", "fguillot/simpleLogger" : "1.0.0",
"fguillot/simple-validator" : "1.0.0", "fguillot/simple-validator" : "1.0.0",

14
composer.lock generated
View File

@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "ecdd93c089273876816339ff22d67cc7", "hash": "715601e3833e0ee04d8d00d266302f8b",
"content-hash": "a5edc6f9c9ae2cd356e3f8ac96ef5532", "content-hash": "ef38cdd1e92bd2cd299db9c6d429d24f",
"packages": [ "packages": [
{ {
"name": "christian-riesen/base32", "name": "christian-riesen/base32",
@@ -203,16 +203,16 @@
}, },
{ {
"name": "fguillot/json-rpc", "name": "fguillot/json-rpc",
"version": "v1.0.3", "version": "v1.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fguillot/JsonRPC.git", "url": "https://github.com/fguillot/JsonRPC.git",
"reference": "0a77cd311783431c851e4c8eed33858663c17277" "reference": "e915dab71940e7ac251955c785570048f460d332"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fguillot/JsonRPC/zipball/0a77cd311783431c851e4c8eed33858663c17277", "url": "https://api.github.com/repos/fguillot/JsonRPC/zipball/e915dab71940e7ac251955c785570048f460d332",
"reference": "0a77cd311783431c851e4c8eed33858663c17277", "reference": "e915dab71940e7ac251955c785570048f460d332",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -235,7 +235,7 @@
], ],
"description": "Simple Json-RPC client/server library that just works", "description": "Simple Json-RPC client/server library that just works",
"homepage": "https://github.com/fguillot/JsonRPC", "homepage": "https://github.com/fguillot/JsonRPC",
"time": "2015-09-19 02:27:10" "time": "2016-04-27 02:48:10"
}, },
{ {
"name": "fguillot/picodb", "name": "fguillot/picodb",

View File

@@ -35,15 +35,15 @@ abstract class Base extends PHPUnit_Framework_TestCase
{ {
$this->app = new JsonRPC\Client(API_URL); $this->app = new JsonRPC\Client(API_URL);
$this->app->authentication('jsonrpc', API_KEY); $this->app->authentication('jsonrpc', API_KEY);
// $this->app->debug = true; $this->app->getHttpClient()->withDebug();
$this->admin = new JsonRPC\Client(API_URL); $this->admin = new JsonRPC\Client(API_URL);
$this->admin->authentication('admin', 'admin'); $this->admin->authentication('admin', 'admin');
// $this->admin->debug = true; $this->admin->getHttpClient()->withDebug();
$this->user = new JsonRPC\Client(API_URL); $this->user = new JsonRPC\Client(API_URL);
$this->user->authentication('user', 'password'); $this->user->authentication('user', 'password');
// $this->user->debug = true; $this->user->getHttpClient()->withDebug();
} }
protected function getProjectId() protected function getProjectId()

View File

@@ -15,7 +15,7 @@ class MeTest extends Base
} }
/** /**
* @expectedException JsonRPC\AccessDeniedException * @expectedException JsonRPC\Exception\AccessDeniedException
*/ */
public function testNotAllowedAppProcedure() public function testNotAllowedAppProcedure()
{ {
@@ -23,7 +23,7 @@ class MeTest extends Base
} }
/** /**
* @expectedException JsonRPC\AccessDeniedException * @expectedException JsonRPC\Exception\AccessDeniedException
*/ */
public function testNotAllowedUserProcedure() public function testNotAllowedUserProcedure()
{ {
@@ -31,7 +31,7 @@ class MeTest extends Base
} }
/** /**
* @expectedException JsonRPC\AccessDeniedException * @expectedException JsonRPC\Exception\AccessDeniedException
*/ */
public function testNotAllowedProjectForUser() public function testNotAllowedProjectForUser()
{ {
@@ -140,7 +140,7 @@ class MeTest extends Base
} }
/** /**
* @expectedException JsonRPC\AccessDeniedException * @expectedException JsonRPC\Exception\AccessDeniedException
*/ */
public function testGetAdminTask() public function testGetAdminTask()
{ {
@@ -148,7 +148,7 @@ class MeTest extends Base
} }
/** /**
* @expectedException JsonRPC\AccessDeniedException * @expectedException JsonRPC\Exception\AccessDeniedException
*/ */
public function testGetProjectActivityDenied() public function testGetProjectActivityDenied()
{ {