We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e1edad2 commit 3be44f8Copy full SHA for 3be44f8
1 file changed
MongodbExtensionTrait.php
@@ -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