Skip to content

Commit 1127fdf

Browse files
Fix tests
1 parent 1b73c7b commit 1127fdf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Tests/Store/MongoDbStoreTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Lock\Tests\Store;
1313

1414
use MongoDB\Client;
15+
use MongoDB\Driver\Exception\ConnectionTimeoutException;
1516
use Symfony\Component\Lock\Exception\InvalidArgumentException;
1617
use Symfony\Component\Lock\Exception\NotSupportedException;
1718
use Symfony\Component\Lock\Key;
@@ -30,7 +31,11 @@ class MongoDbStoreTest extends AbstractStoreTest
3031
public static function setupBeforeClass(): void
3132
{
3233
$client = self::getMongoClient();
33-
$client->listDatabases();
34+
try {
35+
$client->listDatabases();
36+
} catch (ConnectionTimeoutException $e) {
37+
self::markTestSkipped('MongoDB server not found.');
38+
}
3439
}
3540

3641
private static function getMongoClient(): Client

0 commit comments

Comments
 (0)