Skip to content

Commit

Permalink
fixup! XMLPlugin: Add support for DOM\XMLDocument
Browse files Browse the repository at this point in the history
  • Loading branch information
jnvsor committed Aug 21, 2024
1 parent 31ce2f9 commit 23e6170
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/Parser/XmlPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace Kint\Test\Parser;

use DOM\XMLElement;
use DOM\Element;
use DOMElement;
use Kint\Parser\Parser;
use Kint\Parser\XmlPlugin;
Expand Down Expand Up @@ -106,7 +106,8 @@ public function testParseDOMDocument()
$this->assertInstanceOf(InstanceValue::class, $r->contents);
$this->assertSame(DOMElement::class, $r->contents->classname);
$this->assertSame('x', $r->contents->name);
$this->assertSame(1, $r->contents->size);
// Since PHP 8.1 there's a new schemaTypeInfo property that parses normally
$this->assertSame(KINT_PHP81 ? 1 : 0, $r->contents->size);
$this->assertSame('(function($s){$x = new \\DomDocument(); $x->loadXML($s); return $x;})($v)->firstChild', $r->contents->access_path);

$v = self::TEST_XML_INVALID;
Expand Down Expand Up @@ -144,7 +145,7 @@ public function testParseXMLDocument()

$this->assertNotNull($r);
$this->assertInstanceOf(InstanceValue::class, $r->contents);
$this->assertSame(XMLElement::class, $r->contents->classname);
$this->assertSame(Element::class, $r->contents->classname);
$this->assertSame('x', $r->contents->name);
$this->assertSame(2, $r->contents->size);
$this->assertSame('\\DOM\\XMLDocument::createFromString($v)->firstChild', $r->contents->access_path);
Expand Down

0 comments on commit 23e6170

Please sign in to comment.