Completed
Push — master ( 5e935f...1adcc0 )
by dan
01:52
created

PusherChannelTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 29
rs 10
c 1
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testGetChannelName() 0 4 1
A testGetSocketId() 0 4 1
A testSetChannelName() 0 5 1
A testSetSocketId() 0 5 1
1
<?php
2
3
namespace IrishDan\NotificationBundle\Test;
4
5
6
use IrishDan\NotificationBundle\PusherChannel;
7
8
class PusherChannelTest extends NotificationTestCase
9
{
10
    public function setUp()
11
    {
12
        $this->pusherChannel = new PusherChannel('test_channel', 'test_socket');
0 ignored issues
show
Bug introduced by
The property pusherChannel does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
13
    }
14
15
    public function testGetChannelName()
16
    {
17
        $this->assertEquals('test_channel', $this->pusherChannel->getChannelName());
18
    }
19
20
    public function testGetSocketId()
21
    {
22
        $this->assertEquals('test_socket', $this->pusherChannel->getSocketId());
23
    }
24
25
    public function testSetChannelName()
26
    {
27
        $this->pusherChannel->setChannelName('test_channel_1');
28
        $this->assertEquals('test_channel_1', $this->pusherChannel->getChannelName());
29
    }
30
31
    public function testSetSocketId()
32
    {
33
        $this->pusherChannel->setSocketId('test_socket_1');
34
        $this->assertEquals('test_socket_1', $this->pusherChannel->getSocketId());
35
    }
36
}