Skip to content

Commit 6542ede

Browse files
committed
wamp
1 parent 7e81d65 commit 6542ede

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

WampExtension.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Enqueue\Test;
4+
5+
use Enqueue\Wamp\WampConnectionFactory;
6+
use Enqueue\Wamp\WampContext;
7+
8+
trait WampExtension
9+
{
10+
private function buildWampContext(): WampContext
11+
{
12+
if (false == $dsn = getenv('WAMP_DSN')) {
13+
throw new \PHPUnit_Framework_SkippedTestError('Functional tests are not allowed in this environment');
14+
}
15+
16+
return (new WampConnectionFactory($dsn))->createContext();
17+
}
18+
}

0 commit comments

Comments
 (0)