-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
486 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
engines: | ||
duplication: | ||
enabled: true | ||
config: | ||
languages: | ||
- php | ||
fixme: | ||
enabled: true | ||
phpmd: | ||
enabled: true | ||
ratings: | ||
paths: | ||
- "**.php" | ||
exclude_paths: | ||
- tests/ | ||
- examples/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
/** | ||
* | ||
* * This file is part of the Tidal/WampWatch package. | ||
* * (c) 2016 Timo Michna <timomichna/yahoo.de> | ||
* * | ||
* * For the full copyright and license information, please view the LICENSE | ||
* * file that was distributed with this source code. | ||
* | ||
*/ | ||
|
||
namespace integration\crossbar; | ||
|
||
use Psr\Log\NullLogger; | ||
use Thruway\Logging\Logger; | ||
use Thruway\Connection; | ||
use React\EventLoop\Factory as LoopFactory; | ||
use React\EventLoop\LoopInterface; | ||
|
||
trait CrossbarTestingTrait | ||
{ | ||
/** | ||
* @var Connection | ||
*/ | ||
private $connection; | ||
|
||
/** | ||
* @var LoopInterface | ||
*/ | ||
private $loop; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
private $clientSessionId = -1; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
private $monitoredSessionId = -2; | ||
|
||
private function setupConnection() | ||
{ | ||
|
||
$this->clientSessionId = -1; | ||
$this->monitoredSessionId = -2; | ||
|
||
Logger::set(new NullLogger()); | ||
|
||
$this->loop = LoopFactory::create(); | ||
|
||
$this->connection = $this->createConnection($this->loop); | ||
|
||
} | ||
|
||
/** | ||
* @param \React\EventLoop\LoopInterface|null $loop | ||
* | ||
* @return \Thruway\Connection | ||
*/ | ||
private function createConnection(LoopInterface $loop = null) | ||
{ | ||
if ($loop === null) { | ||
$loop = LoopFactory::create(); | ||
} | ||
|
||
return new Connection( | ||
[ | ||
'realm' => self::REALM_NAME, | ||
'url' => self::ROUTER_URL, | ||
], | ||
$loop | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.