pluginsEnabled[] = 'odt';
parent::setUp();
}
/**
* Test function getElement()
*/
public function test_getElement_1() {
$xmlCode = 'Hallo';
$found = XMLUtil::getElement('a', $xmlCode, $end);
$this->assertNotNull($found);
$this->assertEquals($xmlCode, $found);
$this->assertEquals(strlen($xmlCode), $end);
}
/**
* Test function getElement()
*/
public function test_getElement_2() {
$xmlCode = 'Hallo';
$found = XMLUtil::getElement('a', $xmlCode, $end);
$this->assertNotNull($found);
$this->assertEquals($xmlCode, $found);
$this->assertEquals(strlen($xmlCode), $end);
}
/**
* Test function getElement()
*/
public function test_getElement_3() {
$xmlCode = 'Hallo';
$found = XMLUtil::getElement('a', $xmlCode, $end);
$this->assertNotNull($found);
$this->assertEquals('Hallo', $found);
$this->assertEquals(strlen($xmlCode), $end);
}
/**
* Test function getElement()
*/
public function test_getElement_4() {
$xmlCode = 'Hallo';
$found = XMLUtil::getElement('a', $xmlCode, $end);
$this->assertNotNull($found);
$this->assertEquals('Hallo', $found);
$this->assertEquals(strlen($xmlCode)-strlen(''), $end);
}
/**
* Test function getElement()
*/
public function test_getElement_5() {
$xmlCode = '';
$found = XMLUtil::getElement('a', $xmlCode, $end);
$this->assertNotNull($found);
$this->assertEquals('', $found);
$this->assertEquals(strlen($xmlCode)-strlen(''), $end);
$this->assertEquals(23, $end);
}
/**
* Test function getElementContent()
*/
public function test_getElementContent_1() {
$xmlCode = 'Hallo';
$found = XMLUtil::getElementContent('a', $xmlCode, $end);
$this->assertNotNull($found);
$this->assertEquals('Hallo', $found);
$this->assertEquals(strlen($xmlCode), $end);
}
/**
* Test function getElement()
*/
public function test_getElementContent_2() {
$xmlCode = '';
$found = XMLUtil::getElementContent('a', $xmlCode, $end);
$this->assertNull($found);
$this->assertEquals(strlen($xmlCode)-strlen(''), $end);
}
/**
* Test function getElement()
*/
public function test_getElementContent_3() {
$xmlCode = '';
$found = XMLUtil::getElementContent('abc', $xmlCode, $end);
$this->assertNull($found);
$this->assertEquals(strlen($xmlCode)-strlen(''), $end);
}
/**
* Test function getNextElement()
*/
public function test_getNextElement_1() {
$xmlCode = 'Hallo';
$found = XMLUtil::getNextElement($element, $xmlCode, $end);
$this->assertNotNull($found);
$this->assertEquals('Hallo', $found);
$this->assertEquals(strlen($xmlCode)-strlen(''), $end);
$this->assertEquals('unknown', $element);
}
/**
* Test function getNextElement()
*/
public function test_getNextElementContent_1() {
$xmlCode = 'Hallo';
$found = XMLUtil::getNextElementContent($element, $xmlCode, $end);
$this->assertNotNull($found);
$this->assertEquals('Hallo', $found);
$this->assertEquals(strlen($xmlCode)-strlen(''), $end);
$this->assertEquals('unknown', $element);
}
/**
* Test function getAttributes()
*/
public function test_getAttributes() {
$xmlCode = '';
$attributes = array();
$found = XMLUtil::getAttributes($attributes, $xmlCode);
$this->assertEquals(5, $found);
$this->assertEquals('1', $attributes['attr1']);
$this->assertEquals('22', $attributes['attr2']);
$this->assertEquals('333', $attributes['attr3']);
$this->assertEquals('4444', $attributes['attr4']);
$this->assertEquals('55555', $attributes['attr5']);
}
}