X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fnetscape%2FBookmarkImportTest.php;h=c526d5c8382699c27a57ffbc12622e153c42c4cf;hb=fd1ddad98df45bc3c18be7980c1cbe68ce6b219c;hp=f678e26bd5ca8d3199242d33f6613bb36f7afecc;hpb=78657347c5b463d7c22bfc8c87b7db39fe058833;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/netscape/BookmarkImportTest.php b/tests/netscape/BookmarkImportTest.php index f678e26b..c526d5c8 100644 --- a/tests/netscape/BookmarkImportTest.php +++ b/tests/netscape/BookmarkImportTest.php @@ -3,13 +3,14 @@ namespace Shaarli\Netscape; use DateTime; -use PHPUnit\Framework\TestCase; +use malkusch\lock\mutex\NoMutex; use Psr\Http\Message\UploadedFileInterface; use Shaarli\Bookmark\Bookmark; use Shaarli\Bookmark\BookmarkFileService; use Shaarli\Bookmark\BookmarkFilter; use Shaarli\Config\ConfigManager; use Shaarli\History; +use Shaarli\TestCase; use Slim\Http\UploadedFile; /** @@ -75,7 +76,7 @@ class BookmarkImportTest extends TestCase */ protected static $defaultTimeZone; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$defaultTimeZone = date_default_timezone_get(); // Timezone without DST for test consistency @@ -85,8 +86,9 @@ class BookmarkImportTest extends TestCase /** * Resets test data before each test */ - protected function setUp() + protected function setUp(): void { + $mutex = new NoMutex(); if (file_exists(self::$testDatastore)) { unlink(self::$testDatastore); } @@ -97,19 +99,19 @@ class BookmarkImportTest extends TestCase $this->conf->set('resource.page_cache', $this->pagecache); $this->conf->set('resource.datastore', self::$testDatastore); $this->history = new History(self::$historyFilePath); - $this->bookmarkService = new BookmarkFileService($this->conf, $this->history, true); + $this->bookmarkService = new BookmarkFileService($this->conf, $this->history, $mutex, true); $this->netscapeBookmarkUtils = new NetscapeBookmarkUtils($this->bookmarkService, $this->conf, $this->history); } /** * Delete history file. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$historyFilePath); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { date_default_timezone_set(self::$defaultTimeZone); }