]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/netscape/BookmarkImportTest.php
Add mutex on datastore I/O operations
[github/shaarli/Shaarli.git] / tests / netscape / BookmarkImportTest.php
index 89ae4aa709b5cd2df82fb799ee63e89ed8c5b853..c526d5c8382699c27a57ffbc12622e153c42c4cf 100644 (file)
@@ -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;
 
 /**
@@ -87,6 +88,7 @@ class BookmarkImportTest extends TestCase
      */
     protected function setUp(): void
     {
+        $mutex = new NoMutex();
         if (file_exists(self::$testDatastore)) {
             unlink(self::$testDatastore);
         }
@@ -97,7 +99,7 @@ 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);
     }