File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/Symfony/Component/Lock/Tests/Store Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \Lock \Tests \Store ;
13
13
14
14
use MongoDB \Client ;
15
+ use MongoDB \Driver \Exception \ConnectionTimeoutException ;
15
16
use Symfony \Component \Lock \Exception \InvalidArgumentException ;
16
17
use Symfony \Component \Lock \Exception \NotSupportedException ;
17
18
use Symfony \Component \Lock \Key ;
@@ -30,8 +31,12 @@ class MongoDbStoreTest extends AbstractStoreTest
30
31
31
32
public static function setupBeforeClass (): void
32
33
{
33
- $ client = self ::getMongoClient ();
34
- $ client ->listDatabases ();
34
+ try {
35
+ $ client = self ::getMongoClient ();
36
+ $ client ->listDatabases ();
37
+ } catch (ConnectionTimeoutException $ e ) {
38
+ self ::markTestSkipped ('No mongodb server running. ' );
39
+ }
35
40
}
36
41
37
42
private static function getMongoClient (): Client
You can’t perform that action at this time.
0 commit comments