* @author Stephan Wentz * @author Michael Garvin * @copyright 2008 Nathanael C. Fritz */ /** XMPPHP_XMLObj */ require_once CLASS_DIR . 'XMPPHP' . DIRECTORY_SEPARATOR . 'XMLObj.php'; /** * XMPPHP XMLObjectTest * * @package XMPPHP * @author Nathanael C. Fritz * @author Stephan Wentz * @author Michael Garvin * @copyright 2008 Nathanael C. Fritz * @version $Id$ */ class XMPPHP_XMLObjTest extends PHPUnit_Framework_TestCase { public function testToStringNameNamespace() { $xmlobj = new XMPPHP_XMLObj('testname', 'testNameSpace'); $expected = ''; $result = $xmlobj->toString(); $this->assertSame($expected, $result); } public function testToStringNameNamespaceAttr() { $xmlobj = new XMPPHP_XMLObj('testName', 'testNameSpace', ['attr1' => 'valA', 'attr2' => 'valB']); $expected = ''; $result = $xmlobj->toString(); $this->assertSame($expected, $result); } public function testToStringNameNamespaceData() { $xmlobj = new XMPPHP_XMLObj('testName', 'testNameSpace', [], 'I am test data'); $expected = 'I am test data'; $result = $xmlobj->toString(); $this->assertSame($expected, $result); } public function testToStringNameNamespaceSub() { $xmlobj = new XMPPHP_XMLObj('testName', 'testNameSpace'); $sub1 = new XMPPHP_XMLObj('subName', 'subNameSpace'); $xmlobj->subs = [$sub1]; $expected = ''; $result = $xmlobj->toString(); $this->assertSame($expected, $result); } }