Skip to content

Commit e7428ed

Browse files
committed
Merge branch 'master' into 0.9
2 parents da3a485 + fe1cf7d commit e7428ed

2 files changed

Lines changed: 24 additions & 1 deletion

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+
}

SqsExtension.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)