File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change @@ -12,14 +12,16 @@ trait SqsExtension
1212 */
1313 private function buildSqsContext ()
1414 {
15- if (false == getenv ('AWS_SQS_KEY ' )) {
15+ if (false == getenv ('AWS_SQS_ENDPOINT ' ) && false == getenv ( ' AWS_SQS_KEY ' )) {
1616 throw new \PHPUnit_Framework_SkippedTestError ('Functional tests are not allowed in this environment ' );
1717 }
1818
1919 $ config = [
2020 'key ' => getenv ('AWS_SQS_KEY ' ),
2121 'secret ' => getenv ('AWS_SQS_SECRET ' ),
2222 'region ' => getenv ('AWS_SQS_REGION ' ),
23+ 'version ' => getenv ('AWS_SQS_VERSION ' ),
24+ 'endpoint ' => getenv ('AWS_SQS_ENDPOINT ' ),
2325 'lazy ' => false ,
2426 ];
2527
You can’t perform that action at this time.
0 commit comments