PusherManagerTest::testGetUserChannelName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
}