/** * Renders a node through default renderer. * * This function passes any "visit" prefixed function through to the default * render, and any other method call is passed to the parent * SimpleXmlElement function call handler. * * @param string $method method name that has been called (visit..) * @param array $arg array of arguments */ function __call($method, $arg) { if (strcmp(substr($method, 0, 5), 'visit') === 0) { return $this->renderDefault($arg[0]); } else { return parent::__call($method, $arg); } }
function testCanGetNameOfRootObject() { $xml = new T_Xml('<root>data</root>'); $expect = new T_Xml_Element('<root>data</root>'); $this->assertSame($xml->getName(), $expect->getName()); }