Skip to content

Commit d2b4bb8

Browse files
author
Greg Bowler
committed
tweak: php 8.4 changes
1 parent 6826fec commit d2b4bb8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

test/phpunit/NodeTest.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ public function testCanNotConstruct():void {
2121
public function testBaseURIClientSideOnly():void {
2222
$document = new XMLDocument();
2323
$sut = $document->createElement("example");
24-
self::assertNull($sut->baseURI);
24+
25+
if(version_compare(PHP_VERSION, "8.4", ">=")) {
26+
self::assertEquals(getcwd() . "/", $sut->baseURI);
27+
}
28+
else {
29+
self::assertNull($sut->baseURI);
30+
}
2531
}
2632

2733
public function testChildNodesEmpty():void {

test/phpunit/XMLDocumentTest.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ public function testBodyNullOnXML():void {
2424

2525
public function testToStringEmptyXML():void {
2626
$sut = new XMLDocument();
27-
self::assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xml/>\n", (string)$sut);
27+
if(version_compare(PHP_VERSION, "8.4", ">=")) {
28+
self::assertEquals("<?xml version=\"1.0\"?>\n<xml/>\n", (string)$sut);
29+
}
30+
else {
31+
self::assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xml/>\n", (string)$sut);
32+
}
2833
}
2934

3035
public function testPropContentTypeEmpty():void {

0 commit comments

Comments
 (0)