Jyxo\XmlReaderTest::testGetTextValue PHP Method

testGetTextValue() public method

Tests the getTextValue() method.
See also: Jyxo\XmlReader::getTextValue()
public testGetTextValue ( )
    public function testGetTextValue()
    {
        // In the form: tag (key), expected value (value)
        $tests = [];
        $tests['zero'] = '';
        $tests['one'] = 'word';
        $tests['second'] = 'two words';
        $tests['third'] = 'three simple words';
        $tests['forth'] = "\n\t\tfour words on several lines\n\t";
        $tests['fifth'] = 'fifth test with tags';
        $tests['sixth'] = 'sixth test with tags and inner tags';
        $this->reader->open($this->path . '/text.xml');
        $this->reader->next('test');
        while ($this->reader->read()) {
            if ($this->reader->nodeType == \XMLReader::ELEMENT) {
                $this->assertEquals($tests[$this->reader->name], $this->reader->getTextValue());
            }
        }
    }