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

PusherChannelTest::testGetChannelName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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