Example #1
0
 public function testStrings()
 {
     $xml = "<entry>\n    <title> Using C++ Intrinsic Functions for Pipelined Text Processing</title>\n    <id>http://www.oreillynet.com/pub/wlg/8356</id>\n    <link rel='alternate' href='http://www.oreillynet.com/pub/wlg/8356'/>\n    <summary type='xhtml'>\n    <div xmlns='http://www.w3.org/1999/xhtml'>\n    A good C++ programming technique that has almost no published material available on the WWW relates to using the special pipeline instructions in modern CPUs for faster text processing. Here's example code using C++ intrinsic functions to give a fourfold speed increase for a UTF-8 to UTF-16 converter compared to the original C/C++ code.\n    </div>\n    </summary>\n    <author><name>Rick Jelliffe</name></author>\n    <updated>2005-11-07T08:15:57-08:00</updated>\n</entry>";
     $element = new Horde_Xml_Element($xml);
     $this->assertTrue($element->summary instanceof Horde_Xml_Element, '__get access should return a Horde_Xml_Element instance');
     $this->assertFalse($element->summary() instanceof Horde_Xml_Element, 'method access should not return a Horde_Xml_Element instance');
     $this->assertTrue(is_string($element->summary()), 'method access should return a string');
     $this->assertFalse(is_string($element->summary), '__get access should not return a string');
 }