public function testExtend() { $newMethods = array('newMethod1' => array($this, 'callback1'), 'newMethod2' => array($this, 'callback2')); PhpQuery::extend('PhpQueryObject', $newMethods); $doc = PhpQuery::newDocumentXML("<div/>"); $this->assertTrue($doc->newMethod1() == $doc, '$doc->newMethod1 == $doc'); $this->assertTrue($doc->newMethod2() == "callback2", '$doc->newMethod1 == "callback2"'); }