for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace IrishDan\NotificationBundle\Test;
use IrishDan\NotificationBundle\PusherChannel;
class PusherChannelTest extends NotificationTestCase
{
public function setUp()
$this->pusherChannel = new PusherChannel('test_channel', 'test_socket');
pusherChannel
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;
}
public function testGetChannelName()
$this->assertEquals('test_channel', $this->pusherChannel->getChannelName());
public function testGetSocketId()
$this->assertEquals('test_socket', $this->pusherChannel->getSocketId());
public function testSetChannelName()
$this->pusherChannel->setChannelName('test_channel_1');
$this->assertEquals('test_channel_1', $this->pusherChannel->getChannelName());
public function testSetSocketId()
$this->pusherChannel->setSocketId('test_socket_1');
$this->assertEquals('test_socket_1', $this->pusherChannel->getSocketId());
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: