Unit Tests and fixes

Set some incomplete tests to pass
Updated an interface bug found from unit tests
This commit is contained in:
Chris Boden 2011-11-20 22:36:14 -05:00
parent 1b01582ab9
commit 0670568789
3 changed files with 11 additions and 11 deletions

View File

@ -49,7 +49,7 @@ class Connection {
* @return mixed
* @throws \InvalidArgumentException
*/
public function &__get($name) {
public function __get($name) {
if (!$this->__isset($name)) {
throw new \InvalidArgumentException("Attribute '{$name}' not found in Connection {$this->getID()}");
}

View File

@ -240,17 +240,16 @@ class FrameTest extends \PHPUnit_Framework_TestCase {
}
/**
* @dataProvider messageFragmentProvider
* @dataProvider UnframeMessageProvider
*/
public function testCheckPiecingTogetherMessage($coalesced, $first_bin, $secnd_bin, $mask, $payload1, $payload2) {
return $this->markTestIncomplete('Ran out of time, had to attend to something else, come finish me!');
public function testCheckPiecingTogetherMessage($msg, $encoded) {
// return $this->markTestIncomplete('Ran out of time, had to attend to something else, come finish me!');
$this->_frame->addBuffer(static::convert($first_bin));
$this->_frame->addBuffer(static::convert($second_bin));
// mask?
// $this->_frame->addBuffer(
// $this->_frame->addBuffer(
$framed = base64_decode($encoded);
for ($i = 0, $len = strlen($framed);$i < $len; $i++) {
$this->_frame->addBuffer(substr($framed, $i, 1));
}
$this->assertEquals($coalesced, $this->_frame->isCoalesced());
$this->assertEquals($msg, $this->_frame->getPayload());
}
}

View File

@ -39,7 +39,8 @@ class ConnectionTest extends \PHPUnit_Framework_TestCase {
}
public function testLambdaReturnValueOnGet() {
$this->markTestIncomplete();
$this->_c->lambda = function() { return 'Hello World!'; };
$this->assertEquals('Hello World!', $this->_c->lambda);
}
/**