diff options
author | ArthurHoaro <arthur@hoa.ro> | 2019-08-10 12:31:32 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-01-17 18:34:37 +0100 |
commit | def39d0dd7a81a4af9ad68b62c9e9823fbc2b38e (patch) | |
tree | 676b02604ae6f358ddb90c59c549465f6e9d6214 /application/api/ApiUtils.php | |
parent | ef028857531a6abe2d7180538b8510502ee2a467 (diff) | |
download | Shaarli-def39d0dd7a81a4af9ad68b62c9e9823fbc2b38e.tar.gz Shaarli-def39d0dd7a81a4af9ad68b62c9e9823fbc2b38e.tar.zst Shaarli-def39d0dd7a81a4af9ad68b62c9e9823fbc2b38e.zip |
Run Unit Tests against PHP 7.4
Bump PHPUnit version and fix unit test
- Globals are handled differently and are persistent through tests
- Tests without assertions are marked as risky: some of them are just
meant to check that no error is raised.
Diffstat (limited to 'application/api/ApiUtils.php')
-rw-r--r-- | application/api/ApiUtils.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/application/api/ApiUtils.php b/application/api/ApiUtils.php index 1e3ac02e..5ac07c4d 100644 --- a/application/api/ApiUtils.php +++ b/application/api/ApiUtils.php | |||
@@ -15,6 +15,8 @@ class ApiUtils | |||
15 | * @param string $token JWT token extracted from the headers. | 15 | * @param string $token JWT token extracted from the headers. |
16 | * @param string $secret API secret set in the settings. | 16 | * @param string $secret API secret set in the settings. |
17 | * | 17 | * |
18 | * @return bool true on success | ||
19 | * | ||
18 | * @throws ApiAuthorizationException the token is not valid. | 20 | * @throws ApiAuthorizationException the token is not valid. |
19 | */ | 21 | */ |
20 | public static function validateJwtToken($token, $secret) | 22 | public static function validateJwtToken($token, $secret) |
@@ -45,6 +47,8 @@ class ApiUtils | |||
45 | ) { | 47 | ) { |
46 | throw new ApiAuthorizationException('Invalid JWT issued time'); | 48 | throw new ApiAuthorizationException('Invalid JWT issued time'); |
47 | } | 49 | } |
50 | |||
51 | return true; | ||
48 | } | 52 | } |
49 | 53 | ||
50 | /** | 54 | /** |