Skip to content

Commit 3be44f8

Browse files
committed
mongodb transport, fixes
1 parent e1edad2 commit 3be44f8

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

MongodbExtensionTrait.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Enqueue\Test;
4+
5+
use Enqueue\Mongodb\MongodbConnectionFactory;
6+
7+
trait MongodbExtensionTrait
8+
{
9+
protected function buildMongodbContext()
10+
{
11+
if (false == $env = getenv('MONGO_DSN')) {
12+
$this->markTestSkipped('The MONGO_DSN env is not available. Skip tests');
13+
}
14+
15+
$factory = new MongodbConnectionFactory(['dsn' => $env]);
16+
17+
$context = $factory->createContext();
18+
19+
return $context;
20+
}
21+
}

0 commit comments

Comments
 (0)