4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\VarDumper\Tests\Caster;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
18 * @author Baptiste Clavié <clavie.b@gmail.com>
20 class XmlReaderCasterTest extends TestCase
22 use VarDumperTestTrait;
24 /** @var \XmlReader */
27 protected function setUp()
29 $this->reader = new \XmlReader();
30 $this->reader->open(__DIR__.'/../Fixtures/xml_reader.xml');
33 protected function tearDown()
35 $this->reader->close();
38 public function testParserProperty()
40 $this->reader->setParserProperty(\XMLReader::SUBST_ENTITIES, true);
42 $expectedDump = <<<'EODUMP'
53 $this->assertDumpMatchesFormat($expectedDump, $this->reader);
57 * @dataProvider provideNodes
59 public function testNodes($seek, $expectedDump)
62 $this->reader->read();
64 $this->assertDumpMatchesFormat($expectedDump, $this->reader);
67 public function provideNodes()
81 +baseURI: "%sxml_reader.xml"
89 +nodeType: SIGNIFICANT_WHITESPACE
95 +baseURI: "%sxml_reader.xml"
105 +baseURI: "%sxml_reader.xml"
113 +nodeType: END_ELEMENT
115 +baseURI: "%sxml_reader.xml"
125 +isEmptyElement: true
126 +baseURI: "%sxml_reader.xml"
137 +baseURI: "%sxml_reader.xml"
142 array(12, <<<'EODUMP'
148 +baseURI: "%sxml_reader.xml"
153 array(13, <<<'EODUMP'
156 +nodeType: END_ELEMENT
158 +baseURI: "%sxml_reader.xml"
163 array(15, <<<'EODUMP'
169 +baseURI: "%sxml_reader.xml"
174 array(16, <<<'EODUMP'
177 +nodeType: SIGNIFICANT_WHITESPACE
183 +baseURI: "%sxml_reader.xml"
188 array(17, <<<'EODUMP'
194 +namespaceURI: "http://symfony.com"
195 +baseURI: "%sxml_reader.xml"
200 array(18, <<<'EODUMP'
204 +nodeType: END_ELEMENT
206 +namespaceURI: "http://symfony.com"
207 +baseURI: "%sxml_reader.xml"
212 array(19, <<<'EODUMP'
215 +nodeType: SIGNIFICANT_WHITESPACE
221 +baseURI: "%sxml_reader.xml"
226 array(21, <<<'EODUMP'
229 +nodeType: SIGNIFICANT_WHITESPACE
232 +baseURI: "%sxml_reader.xml"
237 array(22, <<<'EODUMP'
240 +nodeType: END_ELEMENT
241 +baseURI: "%sxml_reader.xml"