diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-09-29 14:41:40 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-09-29 18:57:20 +0200 |
commit | a5a9cf23acd1248585173aa32757d9720b5f2d62 (patch) | |
tree | 5b443e09fc0f84db0cb478cda0c88c10346b0843 /tests/api | |
parent | 2b7a7bc928fb7fc171138e248d3aa1d86d5b62f9 (diff) | |
download | Shaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.tar.gz Shaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.tar.zst Shaarli-a5a9cf23acd1248585173aa32757d9720b5f2d62.zip |
Compatibility with PHPUnit 9
Diffstat (limited to 'tests/api')
-rw-r--r-- | tests/api/ApiMiddlewareTest.php | 14 | ||||
-rw-r--r-- | tests/api/ApiUtilsTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/history/HistoryTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/info/InfoTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/links/DeleteLinkTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/links/GetLinkIdTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/links/GetLinksTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/links/PostLinkTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/links/PutLinkTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/tags/DeleteTagTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/tags/GetTagNameTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/tags/GetTagsTest.php | 2 | ||||
-rw-r--r-- | tests/api/controllers/tags/PutTagTest.php | 2 |
13 files changed, 19 insertions, 19 deletions
diff --git a/tests/api/ApiMiddlewareTest.php b/tests/api/ApiMiddlewareTest.php index b157e4a7..7386e435 100644 --- a/tests/api/ApiMiddlewareTest.php +++ b/tests/api/ApiMiddlewareTest.php | |||
@@ -18,7 +18,7 @@ use Slim\Http\Response; | |||
18 | * | 18 | * |
19 | * @package Api | 19 | * @package Api |
20 | */ | 20 | */ |
21 | class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase | 21 | class ApiMiddlewareTest extends \Shaarli\TestCase |
22 | { | 22 | { |
23 | /** | 23 | /** |
24 | * @var string datastore to test write operations | 24 | * @var string datastore to test write operations |
@@ -26,7 +26,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase | |||
26 | protected static $testDatastore = 'sandbox/datastore.php'; | 26 | protected static $testDatastore = 'sandbox/datastore.php'; |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * @var \ConfigManager instance | 29 | * @var ConfigManager instance |
30 | */ | 30 | */ |
31 | protected $conf; | 31 | protected $conf; |
32 | 32 | ||
@@ -109,7 +109,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase | |||
109 | $this->assertEquals(401, $response->getStatusCode()); | 109 | $this->assertEquals(401, $response->getStatusCode()); |
110 | $body = json_decode((string) $response->getBody()); | 110 | $body = json_decode((string) $response->getBody()); |
111 | $this->assertEquals('Not authorized: API is disabled', $body->message); | 111 | $this->assertEquals('Not authorized: API is disabled', $body->message); |
112 | $this->assertContains('ApiAuthorizationException', $body->stacktrace); | 112 | $this->assertContainsPolyfill('ApiAuthorizationException', $body->stacktrace); |
113 | } | 113 | } |
114 | 114 | ||
115 | /** | 115 | /** |
@@ -132,7 +132,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase | |||
132 | $this->assertEquals(401, $response->getStatusCode()); | 132 | $this->assertEquals(401, $response->getStatusCode()); |
133 | $body = json_decode((string) $response->getBody()); | 133 | $body = json_decode((string) $response->getBody()); |
134 | $this->assertEquals('Not authorized: JWT token not provided', $body->message); | 134 | $this->assertEquals('Not authorized: JWT token not provided', $body->message); |
135 | $this->assertContains('ApiAuthorizationException', $body->stacktrace); | 135 | $this->assertContainsPolyfill('ApiAuthorizationException', $body->stacktrace); |
136 | } | 136 | } |
137 | 137 | ||
138 | /** | 138 | /** |
@@ -157,7 +157,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase | |||
157 | $this->assertEquals(401, $response->getStatusCode()); | 157 | $this->assertEquals(401, $response->getStatusCode()); |
158 | $body = json_decode((string) $response->getBody()); | 158 | $body = json_decode((string) $response->getBody()); |
159 | $this->assertEquals('Not authorized: Token secret must be set in Shaarli\'s administration', $body->message); | 159 | $this->assertEquals('Not authorized: Token secret must be set in Shaarli\'s administration', $body->message); |
160 | $this->assertContains('ApiAuthorizationException', $body->stacktrace); | 160 | $this->assertContainsPolyfill('ApiAuthorizationException', $body->stacktrace); |
161 | } | 161 | } |
162 | 162 | ||
163 | /** | 163 | /** |
@@ -180,7 +180,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase | |||
180 | $this->assertEquals(401, $response->getStatusCode()); | 180 | $this->assertEquals(401, $response->getStatusCode()); |
181 | $body = json_decode((string) $response->getBody()); | 181 | $body = json_decode((string) $response->getBody()); |
182 | $this->assertEquals('Not authorized: Invalid JWT header', $body->message); | 182 | $this->assertEquals('Not authorized: Invalid JWT header', $body->message); |
183 | $this->assertContains('ApiAuthorizationException', $body->stacktrace); | 183 | $this->assertContainsPolyfill('ApiAuthorizationException', $body->stacktrace); |
184 | } | 184 | } |
185 | 185 | ||
186 | /** | 186 | /** |
@@ -206,6 +206,6 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase | |||
206 | $this->assertEquals(401, $response->getStatusCode()); | 206 | $this->assertEquals(401, $response->getStatusCode()); |
207 | $body = json_decode((string) $response->getBody()); | 207 | $body = json_decode((string) $response->getBody()); |
208 | $this->assertEquals('Not authorized: Malformed JWT token', $body->message); | 208 | $this->assertEquals('Not authorized: Malformed JWT token', $body->message); |
209 | $this->assertContains('ApiAuthorizationException', $body->stacktrace); | 209 | $this->assertContainsPolyfill('ApiAuthorizationException', $body->stacktrace); |
210 | } | 210 | } |
211 | } | 211 | } |
diff --git a/tests/api/ApiUtilsTest.php b/tests/api/ApiUtilsTest.php index 96787014..7a143859 100644 --- a/tests/api/ApiUtilsTest.php +++ b/tests/api/ApiUtilsTest.php | |||
@@ -8,7 +8,7 @@ use Shaarli\Http\Base64Url; | |||
8 | /** | 8 | /** |
9 | * Class ApiUtilsTest | 9 | * Class ApiUtilsTest |
10 | */ | 10 | */ |
11 | class ApiUtilsTest extends \PHPUnit\Framework\TestCase | 11 | class ApiUtilsTest extends \Shaarli\TestCase |
12 | { | 12 | { |
13 | /** | 13 | /** |
14 | * Force the timezone for ISO datetimes. | 14 | * Force the timezone for ISO datetimes. |
diff --git a/tests/api/controllers/history/HistoryTest.php b/tests/api/controllers/history/HistoryTest.php index 40f26b12..84f8716e 100644 --- a/tests/api/controllers/history/HistoryTest.php +++ b/tests/api/controllers/history/HistoryTest.php | |||
@@ -11,7 +11,7 @@ use Slim\Http\Response; | |||
11 | 11 | ||
12 | require_once 'tests/utils/ReferenceHistory.php'; | 12 | require_once 'tests/utils/ReferenceHistory.php'; |
13 | 13 | ||
14 | class HistoryTest extends \PHPUnit\Framework\TestCase | 14 | class HistoryTest extends \Shaarli\TestCase |
15 | { | 15 | { |
16 | /** | 16 | /** |
17 | * @var string datastore to test write operations | 17 | * @var string datastore to test write operations |
diff --git a/tests/api/controllers/info/InfoTest.php b/tests/api/controllers/info/InfoTest.php index cc50d2e3..1598e1e8 100644 --- a/tests/api/controllers/info/InfoTest.php +++ b/tests/api/controllers/info/InfoTest.php | |||
@@ -1,10 +1,10 @@ | |||
1 | <?php | 1 | <?php |
2 | namespace Shaarli\Api\Controllers; | 2 | namespace Shaarli\Api\Controllers; |
3 | 3 | ||
4 | use PHPUnit\Framework\TestCase; | ||
5 | use Shaarli\Bookmark\BookmarkFileService; | 4 | use Shaarli\Bookmark\BookmarkFileService; |
6 | use Shaarli\Config\ConfigManager; | 5 | use Shaarli\Config\ConfigManager; |
7 | use Shaarli\History; | 6 | use Shaarli\History; |
7 | use Shaarli\TestCase; | ||
8 | use Slim\Container; | 8 | use Slim\Container; |
9 | use Slim\Http\Environment; | 9 | use Slim\Http\Environment; |
10 | use Slim\Http\Request; | 10 | use Slim\Http\Request; |
diff --git a/tests/api/controllers/links/DeleteLinkTest.php b/tests/api/controllers/links/DeleteLinkTest.php index bd8403cf..cf9464f0 100644 --- a/tests/api/controllers/links/DeleteLinkTest.php +++ b/tests/api/controllers/links/DeleteLinkTest.php | |||
@@ -11,7 +11,7 @@ use Slim\Http\Environment; | |||
11 | use Slim\Http\Request; | 11 | use Slim\Http\Request; |
12 | use Slim\Http\Response; | 12 | use Slim\Http\Response; |
13 | 13 | ||
14 | class DeleteLinkTest extends \PHPUnit\Framework\TestCase | 14 | class DeleteLinkTest extends \Shaarli\TestCase |
15 | { | 15 | { |
16 | /** | 16 | /** |
17 | * @var string datastore to test write operations | 17 | * @var string datastore to test write operations |
diff --git a/tests/api/controllers/links/GetLinkIdTest.php b/tests/api/controllers/links/GetLinkIdTest.php index 3a3aaa7b..99dc606f 100644 --- a/tests/api/controllers/links/GetLinkIdTest.php +++ b/tests/api/controllers/links/GetLinkIdTest.php | |||
@@ -20,7 +20,7 @@ use Slim\Http\Response; | |||
20 | * | 20 | * |
21 | * @package Shaarli\Api\Controllers | 21 | * @package Shaarli\Api\Controllers |
22 | */ | 22 | */ |
23 | class GetLinkIdTest extends \PHPUnit\Framework\TestCase | 23 | class GetLinkIdTest extends \Shaarli\TestCase |
24 | { | 24 | { |
25 | /** | 25 | /** |
26 | * @var string datastore to test write operations | 26 | * @var string datastore to test write operations |
diff --git a/tests/api/controllers/links/GetLinksTest.php b/tests/api/controllers/links/GetLinksTest.php index 01c40c2f..ca1bfc63 100644 --- a/tests/api/controllers/links/GetLinksTest.php +++ b/tests/api/controllers/links/GetLinksTest.php | |||
@@ -20,7 +20,7 @@ use Slim\Http\Response; | |||
20 | * | 20 | * |
21 | * @package Shaarli\Api\Controllers | 21 | * @package Shaarli\Api\Controllers |
22 | */ | 22 | */ |
23 | class GetLinksTest extends \PHPUnit\Framework\TestCase | 23 | class GetLinksTest extends \Shaarli\TestCase |
24 | { | 24 | { |
25 | /** | 25 | /** |
26 | * @var string datastore to test write operations | 26 | * @var string datastore to test write operations |
diff --git a/tests/api/controllers/links/PostLinkTest.php b/tests/api/controllers/links/PostLinkTest.php index b1c9008b..fe3de66f 100644 --- a/tests/api/controllers/links/PostLinkTest.php +++ b/tests/api/controllers/links/PostLinkTest.php | |||
@@ -2,11 +2,11 @@ | |||
2 | 2 | ||
3 | namespace Shaarli\Api\Controllers; | 3 | namespace Shaarli\Api\Controllers; |
4 | 4 | ||
5 | use PHPUnit\Framework\TestCase; | ||
6 | use Shaarli\Bookmark\Bookmark; | 5 | use Shaarli\Bookmark\Bookmark; |
7 | use Shaarli\Bookmark\BookmarkFileService; | 6 | use Shaarli\Bookmark\BookmarkFileService; |
8 | use Shaarli\Config\ConfigManager; | 7 | use Shaarli\Config\ConfigManager; |
9 | use Shaarli\History; | 8 | use Shaarli\History; |
9 | use Shaarli\TestCase; | ||
10 | use Slim\Container; | 10 | use Slim\Container; |
11 | use Slim\Http\Environment; | 11 | use Slim\Http\Environment; |
12 | use Slim\Http\Request; | 12 | use Slim\Http\Request; |
diff --git a/tests/api/controllers/links/PutLinkTest.php b/tests/api/controllers/links/PutLinkTest.php index 3d62a1b1..a2e87c59 100644 --- a/tests/api/controllers/links/PutLinkTest.php +++ b/tests/api/controllers/links/PutLinkTest.php | |||
@@ -12,7 +12,7 @@ use Slim\Http\Environment; | |||
12 | use Slim\Http\Request; | 12 | use Slim\Http\Request; |
13 | use Slim\Http\Response; | 13 | use Slim\Http\Response; |
14 | 14 | ||
15 | class PutLinkTest extends \PHPUnit\Framework\TestCase | 15 | class PutLinkTest extends \Shaarli\TestCase |
16 | { | 16 | { |
17 | /** | 17 | /** |
18 | * @var string datastore to test write operations | 18 | * @var string datastore to test write operations |
diff --git a/tests/api/controllers/tags/DeleteTagTest.php b/tests/api/controllers/tags/DeleteTagTest.php index 0d991b85..1326eb47 100644 --- a/tests/api/controllers/tags/DeleteTagTest.php +++ b/tests/api/controllers/tags/DeleteTagTest.php | |||
@@ -12,7 +12,7 @@ use Slim\Http\Environment; | |||
12 | use Slim\Http\Request; | 12 | use Slim\Http\Request; |
13 | use Slim\Http\Response; | 13 | use Slim\Http\Response; |
14 | 14 | ||
15 | class DeleteTagTest extends \PHPUnit\Framework\TestCase | 15 | class DeleteTagTest extends \Shaarli\TestCase |
16 | { | 16 | { |
17 | /** | 17 | /** |
18 | * @var string datastore to test write operations | 18 | * @var string datastore to test write operations |
diff --git a/tests/api/controllers/tags/GetTagNameTest.php b/tests/api/controllers/tags/GetTagNameTest.php index a2fb89ab..9c05954b 100644 --- a/tests/api/controllers/tags/GetTagNameTest.php +++ b/tests/api/controllers/tags/GetTagNameTest.php | |||
@@ -18,7 +18,7 @@ use Slim\Http\Response; | |||
18 | * | 18 | * |
19 | * @package Shaarli\Api\Controllers | 19 | * @package Shaarli\Api\Controllers |
20 | */ | 20 | */ |
21 | class GetTagNameTest extends \PHPUnit\Framework\TestCase | 21 | class GetTagNameTest extends \Shaarli\TestCase |
22 | { | 22 | { |
23 | /** | 23 | /** |
24 | * @var string datastore to test write operations | 24 | * @var string datastore to test write operations |
diff --git a/tests/api/controllers/tags/GetTagsTest.php b/tests/api/controllers/tags/GetTagsTest.php index ab666f20..3459fdfa 100644 --- a/tests/api/controllers/tags/GetTagsTest.php +++ b/tests/api/controllers/tags/GetTagsTest.php | |||
@@ -17,7 +17,7 @@ use Slim\Http\Response; | |||
17 | * | 17 | * |
18 | * @package Shaarli\Api\Controllers | 18 | * @package Shaarli\Api\Controllers |
19 | */ | 19 | */ |
20 | class GetTagsTest extends \PHPUnit\Framework\TestCase | 20 | class GetTagsTest extends \Shaarli\TestCase |
21 | { | 21 | { |
22 | /** | 22 | /** |
23 | * @var string datastore to test write operations | 23 | * @var string datastore to test write operations |
diff --git a/tests/api/controllers/tags/PutTagTest.php b/tests/api/controllers/tags/PutTagTest.php index 0845dce1..74edde78 100644 --- a/tests/api/controllers/tags/PutTagTest.php +++ b/tests/api/controllers/tags/PutTagTest.php | |||
@@ -12,7 +12,7 @@ use Slim\Http\Environment; | |||
12 | use Slim\Http\Request; | 12 | use Slim\Http\Request; |
13 | use Slim\Http\Response; | 13 | use Slim\Http\Response; |
14 | 14 | ||
15 | class PutTagTest extends \PHPUnit\Framework\TestCase | 15 | class PutTagTest extends \Shaarli\TestCase |
16 | { | 16 | { |
17 | /** | 17 | /** |
18 | * @var string datastore to test write operations | 18 | * @var string datastore to test write operations |