WebsocketServerTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 6
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testWebsocketServerOnSubscribe() 0 15 1
1
<?php
2
3
namespace Eole\Sandstone\Tests\Integration;
4
5
use Psr\Log\NullLogger;
6
use Ratchet\Wamp\WampConnection;
7
8
class WebsocketServerTest extends \PHPUnit_Framework_TestCase
9
{
10
    public function testWebsocketServerOnSubscribe()
11
    {
12
        $app = new App\App();
13
14
        $app->topic('articles', function ($topicPattern) {
15
            return new App\ArticleTopic($topicPattern);
16
        });
17
18
        $wsApp = new \Eole\Sandstone\Websocket\Application($app);
19
        $wsApp->setLogger(new NullLogger());
20
21
        $connectionMock = $this->getMockBuilder(WampConnection::class)->disableOriginalConstructor()->getMock();
22
23
        $wsApp->onSubscribe($connectionMock, 'articles');
24
    }
25
}
26