Skip to content

Commit

Permalink
[VarDumper] Fix DOMCaster test dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-daubois committed Sep 16, 2024
1 parent a5fa748 commit e20e038
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions Tests/Caster/DOMCasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ public function testCastModernText()
);
}

public function testCastAttr()
/**
* @requires PHP < 8.4
*/
public function testCastAttrPriorToPhp84()
{
$attr = new \DOMAttr('attr', 'value');

Expand All @@ -187,6 +190,26 @@ public function testCastAttr()
);
}

/**
* @requires PHP 8.4
*/
public function testCastAttr()
{
$attr = new \DOMAttr('attr', 'value');

$this->assertDumpMatchesFormat(<<<'EODUMP'
DOMAttr {%A
+name: ? string
+specified: ? bool
+value: ? string
+ownerElement: ? ?DOMElement
+schemaTypeInfo: ? mixed
}
EODUMP,
$attr
);
}

/**
* @requires PHP 8.4
*/
Expand All @@ -199,7 +222,7 @@ public function testCastModernAttr()
+name: ? string
+value: ? string
+ownerElement: ? ?Dom\Element
+specified: true
+specified: ? bool
}
EODUMP,
$attr
Expand Down

0 comments on commit e20e038

Please sign in to comment.