Skip to content

Commit e2b06e7

Browse files
committed
Update SimpleXML tests
1 parent 77b124d commit e2b06e7

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

ext/simplexml/tests/bug35785.phpt

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ $xml = simplexml_load_string("<root></root>");
1212
var_dump(isset($xml->bla->posts));
1313
$xml->bla->posts[0]->name = "FooBar";
1414
echo $xml->asXML();
15-
$xml = simplexml_load_string("<root></root>");
16-
$xml->bla->posts[]->name = "FooBar";
17-
echo $xml->asXML();
1815
?>
19-
--EXPECT--
20-
<?xml version="1.0"?>
21-
<root><bla><posts><name>FooBar</name></posts></bla></root>
22-
bool(false)
23-
<?xml version="1.0"?>
24-
<root><bla><posts><name>FooBar</name></posts></bla></root>
25-
<?xml version="1.0"?>
26-
<root><bla><posts><name>FooBar</name></posts></bla></root>
16+
--EXPECTF--
17+
Fatal error: Uncaught Error: Attempt to assign property 'name' of non-object in %s:%d
18+
Stack trace:
19+
#0 {main}
20+
thrown in %s on line %d

ext/simplexml/tests/bug41582.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ $xml->movie[]->characters->character[0]->name = 'Miss Coder';
1313
echo($xml->asXml());
1414

1515
?>
16-
--EXPECT--
17-
<?xml version="1.0" standalone="yes"?>
18-
<collection><movie><characters><character><name>Miss Coder</name></character></characters></movie></collection>
16+
--EXPECTF--
17+
Fatal error: Cannot use [] for reading in %s on line %d

0 commit comments

Comments
 (0)