X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fnetscape%2FBookmarkExportTest.php;h=ad288f78ef802835f238e8d40f4c6c8d9bd2059d;hb=5b74c67461dbfb3fe87486646b64afd14aec4860;hp=a6eacae490b50f07f7cdbae85c1186b1253cdc68;hpb=c3fca560b624588d37508142ab73573caf467573;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/netscape/BookmarkExportTest.php b/tests/netscape/BookmarkExportTest.php index a6eacae4..ad288f78 100644 --- a/tests/netscape/BookmarkExportTest.php +++ b/tests/netscape/BookmarkExportTest.php @@ -2,12 +2,13 @@ namespace Shaarli\Netscape; -use PHPUnit\Framework\TestCase; +use malkusch\lock\mutex\NoMutex; use Shaarli\Bookmark\BookmarkFileService; use Shaarli\Config\ConfigManager; use Shaarli\Formatter\BookmarkFormatter; use Shaarli\Formatter\FormatterFactory; use Shaarli\History; +use Shaarli\TestCase; require_once 'tests/utils/ReferenceLinkDB.php'; @@ -56,12 +57,13 @@ class BookmarkExportTest extends TestCase */ public static function setUpBeforeClass(): void { + $mutex = new NoMutex(); static::$conf = new ConfigManager('tests/utils/config/configJson'); static::$conf->set('resource.datastore', static::$testDatastore); static::$refDb = new \ReferenceLinkDB(); static::$refDb->write(static::$testDatastore); static::$history = new History('sandbox/history.php'); - static::$bookmarkService = new BookmarkFileService(static::$conf, static::$history, true); + static::$bookmarkService = new BookmarkFileService(static::$conf, static::$history, $mutex, true); $factory = new FormatterFactory(static::$conf, true); static::$formatter = $factory->getFormatter('raw'); } @@ -77,10 +79,10 @@ class BookmarkExportTest extends TestCase /** * Attempt to export an invalid link selection - * @expectedException Exception */ public function testFilterAndFormatInvalid() { + $this->expectException(\Exception::class); $this->expectExceptionMessageRegExp('/Invalid export selection/'); $this->netscapeBookmarkUtils->filterAndFormat(