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';
*/
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');
}
/**
* Attempt to export an invalid link selection
- * @expectedException Exception
- * @expectedExceptionMessageRegExp /Invalid export selection/
*/
public function testFilterAndFormatInvalid()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessageRegExp('/Invalid export selection/');
+
$this->netscapeBookmarkUtils->filterAndFormat(
self::$formatter,
'derp',