Skip to content

Commit a7fbcad

Browse files
committed
Skip tests if mongodb/mongodb is not installed
1 parent 1df9484 commit a7fbcad

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/DependencyInjection/MonologExtensionTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,10 @@ public function testElasticsearchAndElasticaHandlers()
936936
/** @group legacy */
937937
public function testMongo()
938938
{
939+
if (!class_exists('MongoDB\Client') {
940+
$this->markTestSkipped('mongodb/mongodb is not installed.');
941+
}
942+
939943
$this->expectDeprecation('Since symfony/monolog-bundle 3.11: The "mongo" handler type is deprecated in MonologBundle since version 3.11.0, use the "mongodb" type instead.');
940944

941945
$container = new ContainerBuilder();
@@ -1008,6 +1012,10 @@ public function testMongo()
10081012

10091013
public function testMongoDB()
10101014
{
1015+
if (!class_exists('MongoDB\Client') {
1016+
$this->markTestSkipped('mongodb/mongodb is not installed.');
1017+
}
1018+
10111019
$container = new ContainerBuilder();
10121020
$container->setDefinition('mongodb.client', new Definition('MongoDB\Client'));
10131021

0 commit comments

Comments
 (0)