mxmbsocket/tests/Ratchet/Tests/Resource/ConnectionTest.php
Chris Boden f3c7dd4d7f Socket Proxy
Replaced passing SocketInterface everywhere with a proxy object
2011-11-14 15:56:30 -05:00

32 lines
768 B
PHP

<?php
namespace Ratchet\Tests\Resource;
use Ratchet\Resource\Connection;
use Ratchet\Tests\Mock\FakeSocket;
/**
* @covers Ratchet\Resource\Connection
*/
class ConnectionTest extends \PHPUnit_Framework_TestCase {
protected $_c;
public function setUp() {
$this->_c = new Connection(new FakeSocket);
}
public function testCanGetWhatIsSet() {
$key = 'hello';
$val = 'world';
$this->_c->{$key} = $val;
$this->assertEquals($val, $this->_c->{$key});
}
public function testExceptionThrownOnInvalidGet() {
$this->setExpectedException('InvalidArgumentException');
$ret = $this->_c->faked;
}
public function testLambdaReturnValueOnGet() {
$this->markTestIncomplete();
}
}