Skip to content

Commit 59fad43

Browse files
committed
[amqp] fixes
1 parent 74f9fde commit 59fad43

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

RabbitmqAmqpExtension.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,16 @@ private function buildAmqpContext()
2626

2727
return (new AmqpConnectionFactory($config))->createContext();
2828
}
29+
30+
/**
31+
* @return AmqpContext
32+
*/
33+
private function buildAmqpContextFromDsn()
34+
{
35+
if (false == $dsn = getenv('AMQP_DSN')) {
36+
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
37+
}
38+
39+
return (new AmqpConnectionFactory($dsn))->createContext();
40+
}
2941
}

0 commit comments

Comments
 (0)