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/updater/UpdaterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/updater') diff --git a/tests/updater/UpdaterTest.php b/tests/updater/UpdaterTest.php index 5cfcd5db..73029e07 100644 --- a/tests/updater/UpdaterTest.php +++ b/tests/updater/UpdaterTest.php @@ -2,11 +2,11 @@ namespace Shaarli\Updater; use Exception; -use PHPUnit\Framework\TestCase; use Shaarli\Bookmark\BookmarkFileService; use Shaarli\Bookmark\BookmarkServiceInterface; use Shaarli\Config\ConfigManager; use Shaarli\History; +use Shaarli\TestCase; /** -- cgit v1.2.3 From ab58f2542072e6bf34acd862f6cfed84b33feb29 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 29 Sep 2020 15:00:11 +0200 Subject: Compatibility with PHP 8 --- tests/updater/DummyUpdater.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/updater') diff --git a/tests/updater/DummyUpdater.php b/tests/updater/DummyUpdater.php index 07c7f5c4..3403233f 100644 --- a/tests/updater/DummyUpdater.php +++ b/tests/updater/DummyUpdater.php @@ -37,7 +37,7 @@ class DummyUpdater extends Updater * * @return bool true. */ - final private function updateMethodDummy1() + final protected function updateMethodDummy1() { return true; } @@ -47,7 +47,7 @@ class DummyUpdater extends Updater * * @return bool true. */ - final private function updateMethodDummy2() + final protected function updateMethodDummy2() { return true; } @@ -57,7 +57,7 @@ class DummyUpdater extends Updater * * @return bool true. */ - final private function updateMethodDummy3() + final protected function updateMethodDummy3() { return true; } @@ -67,7 +67,7 @@ class DummyUpdater extends Updater * * @throws Exception error. */ - final private function updateMethodException() + final protected function updateMethodException() { throw new Exception('whatever'); } -- cgit v1.2.3 From f447edb73b1bcb52e86286467d3ec7b7bdc29948 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 29 Sep 2020 18:41:21 +0200 Subject: Fix missing @expectedException convertion --- tests/updater/UpdaterTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/updater') diff --git a/tests/updater/UpdaterTest.php b/tests/updater/UpdaterTest.php index 73029e07..a6280b8c 100644 --- a/tests/updater/UpdaterTest.php +++ b/tests/updater/UpdaterTest.php @@ -87,11 +87,10 @@ class UpdaterTest extends TestCase /** * Test errors in UpdaterUtils::write_updates_file(): empty updates file. - * - * @expectedException Exception */ public function testWriteEmptyUpdatesFile() { + $this->expectException(\Exception::class); $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/'); UpdaterUtils::write_updates_file('', array('test')); @@ -99,11 +98,10 @@ class UpdaterTest extends TestCase /** * Test errors in UpdaterUtils::write_updates_file(): not writable updates file. - * - * @expectedException Exception */ public function testWriteUpdatesFileNotWritable() { + $this->expectException(\Exception::class); $this->expectExceptionMessageRegExp('/Unable to write(.*)/'); $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; -- cgit v1.2.3