public function testCallingDefinedMethodShouldReturnNodelist() { $o = new stdClass(); $nl = new NodeList(array()); $closure = function () { }; $nl->addMethod('check', $closure); $return = $nl->check('foo', 'bar'); $this->assertSame($nl, $return); }