PusherManagerTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A testGetPusherClient() 0 6 1
A testGetUserChannelName() 0 8 1
1
<?php
2
3
namespace IrishDan\NotificationBundle\Test;
4
5
use IrishDan\NotificationBundle\PusherManager;
6
7
class PusherManagerTest extends NotificationTestCase
8
{
9
    protected $pusherManager;
10
11
    public function setUp()
12
    {
13
        $config = $this->getNotificationChannelConfiguration('pusher');
14
        $this->pusherManager = new PusherManager();
15
        $this->pusherManager->setConfig($config);
16
    }
17
18
    public function testGetPusherClient()
19
    {
20
        $client = $this->pusherManager->getPusherClient();
21
22
        $this->assertInstanceOf(\Pusher::class, $client);
23
    }
24
25
    public function testGetUserChannelName()
26
    {
27
        $user = $this->getTestUser();
28
29
        $channelName = $this->pusherManager->getUserChannelName($user);
30
31
        $this->assertEquals('pusher_test_1', $channelName);
32
    }
33
}