From a5a9cf23acd1248585173aa32757d9720b5f2d62 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 29 Sep 2020 14:41:40 +0200 Subject: Compatibility with PHPUnit 9 --- tests/api/ApiMiddlewareTest.php | 14 +++++++------- tests/api/ApiUtilsTest.php | 2 +- tests/api/controllers/history/HistoryTest.php | 2 +- tests/api/controllers/info/InfoTest.php | 2 +- tests/api/controllers/links/DeleteLinkTest.php | 2 +- tests/api/controllers/links/GetLinkIdTest.php | 2 +- tests/api/controllers/links/GetLinksTest.php | 2 +- tests/api/controllers/links/PostLinkTest.php | 2 +- tests/api/controllers/links/PutLinkTest.php | 2 +- tests/api/controllers/tags/DeleteTagTest.php | 2 +- tests/api/controllers/tags/GetTagNameTest.php | 2 +- tests/api/controllers/tags/GetTagsTest.php | 2 +- tests/api/controllers/tags/PutTagTest.php | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) (limited to 'tests/api') 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; * * @package Api */ -class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase +class ApiMiddlewareTest extends \Shaarli\TestCase { /** * @var string datastore to test write operations @@ -26,7 +26,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase protected static $testDatastore = 'sandbox/datastore.php'; /** - * @var \ConfigManager instance + * @var ConfigManager instance */ protected $conf; @@ -109,7 +109,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase $this->assertEquals(401, $response->getStatusCode()); $body = json_decode((string) $response->getBody()); $this->assertEquals('Not authorized: API is disabled', $body->message); - $this->assertContains('ApiAuthorizationException', $body->stacktrace); + $this->assertContainsPolyfill('ApiAuthorizationException', $body->stacktrace); } /** @@ -132,7 +132,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase $this->assertEquals(401, $response->getStatusCode()); $body = json_decode((string) $response->getBody()); $this->assertEquals('Not authorized: JWT token not provided', $body->message); - $this->assertContains('ApiAuthorizationException', $body->stacktrace); + $this->assertContainsPolyfill('ApiAuthorizationException', $body->stacktrace); } /** @@ -157,7 +157,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase $this->assertEquals(401, $response->getStatusCode()); $body = json_decode((string) $response->getBody()); $this->assertEquals('Not authorized: Token secret must be set in Shaarli\'s administration', $body->message); - $this->assertContains('ApiAuthorizationException', $body->stacktrace); + $this->assertContainsPolyfill('ApiAuthorizationException', $body->stacktrace); } /** @@ -180,7 +180,7 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase $this->assertEquals(401, $response->getStatusCode()); $body = json_decode((string) $response->getBody()); $this->assertEquals('Not authorized: Invalid JWT header', $body->message); - $this->assertContains('ApiAuthorizationException', $body->stacktrace); + $this->assertContainsPolyfill('ApiAuthorizationException', $body->stacktrace); } /** @@ -206,6 +206,6 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase $this->assertEquals(401, $response->getStatusCode()); $body = json_decode((string) $response->getBody()); $this->assertEquals('Not authorized: Malformed JWT token', $body->message); - $this->assertContains('ApiAuthorizationException', $body->stacktrace); + $this->assertContainsPolyfill('ApiAuthorizationException', $body->stacktrace); } } 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; /** * Class ApiUtilsTest */ -class ApiUtilsTest extends \PHPUnit\Framework\TestCase +class ApiUtilsTest extends \Shaarli\TestCase { /** * 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; require_once 'tests/utils/ReferenceHistory.php'; -class HistoryTest extends \PHPUnit\Framework\TestCase +class HistoryTest extends \Shaarli\TestCase { /** * @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 @@