diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2016-11-13 18:16:17 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2016-11-13 18:16:17 +0100 |
commit | 1ccada35c08d35d87706c8c58cc72eebc80b718b (patch) | |
tree | 713ae9f6ec31d7f93a12ef0a2e532ef44943b13a /ext/simplexml/tests | |
parent | 5a4bad7b5f83ff86b0d75ed6557b8e29b76fc645 (diff) | |
download | php-git-1ccada35c08d35d87706c8c58cc72eebc80b718b.tar.gz |
Fix tests: don't count non-countables
Diffstat (limited to 'ext/simplexml/tests')
-rw-r--r-- | ext/simplexml/tests/000.phpt | 9 | ||||
-rw-r--r-- | ext/simplexml/tests/bug35785.phpt | 7 |
2 files changed, 4 insertions, 12 deletions
diff --git a/ext/simplexml/tests/000.phpt b/ext/simplexml/tests/000.phpt index 51dbe3b5ec..ae23dcfdd0 100644 --- a/ext/simplexml/tests/000.phpt +++ b/ext/simplexml/tests/000.phpt @@ -13,7 +13,7 @@ function test($what) echo "===$what\n"; eval("var_dump(isset(\$$what));"); eval("var_dump((bool)\$$what);"); - eval("var_dump(count(\$$what));"); + eval("if (isset(\$$what)) var_dump(count(\$$what));"); eval("var_dump(\$$what);"); } @@ -168,7 +168,6 @@ object(SimpleXMLElement)#%d (2) { ===sxe->elem1[0]->elem2->bla bool(false) bool(false) -int(0) object(SimpleXMLElement)#%d (0) { } ===sxe->elem1[0]["attr1"] @@ -182,7 +181,6 @@ object(SimpleXMLElement)#%d (1) { ===sxe->elem1[0]->attr1 bool(false) bool(false) -int(0) object(SimpleXMLElement)#%d (0) { } ===sxe->elem1[1] @@ -201,7 +199,6 @@ object(SimpleXMLElement)#%d (1) { ===sxe->elem1[2] bool(false) bool(false) -int(0) NULL ===sxe->elem11 bool(true) @@ -233,22 +230,18 @@ object(SimpleXMLElement)#%d (0) { ===sxe->elem22 bool(false) bool(false) -int(0) object(SimpleXMLElement)#%d (0) { } ===sxe->elem22->elem222 bool(false) bool(false) -int(0) NULL ===sxe->elem22->attr22 bool(false) bool(false) -int(0) NULL ===sxe->elem22["attr22"] bool(false) bool(false) -int(0) NULL ===DONE=== diff --git a/ext/simplexml/tests/bug35785.phpt b/ext/simplexml/tests/bug35785.phpt index 0e03f07c55..080a510837 100644 --- a/ext/simplexml/tests/bug35785.phpt +++ b/ext/simplexml/tests/bug35785.phpt @@ -9,9 +9,8 @@ $xml = simplexml_load_string("<root></root>"); $xml->bla->posts->name = "FooBar"; echo $xml->asXML(); $xml = simplexml_load_string("<root></root>"); -$count = count($xml->bla->posts); -var_dump($count); -$xml->bla->posts[$count]->name = "FooBar"; +var_dump(isset($xml->bla->posts)); +$xml->bla->posts[0]->name = "FooBar"; echo $xml->asXML(); $xml = simplexml_load_string("<root></root>"); $xml->bla->posts[]->name = "FooBar"; @@ -22,7 +21,7 @@ echo $xml->asXML(); --EXPECTF-- <?xml version="1.0"?> <root><bla><posts><name>FooBar</name></posts></bla></root> -int(0) +bool(false) <?xml version="1.0"?> <root><bla><posts><name>FooBar</name></posts></bla></root> <?xml version="1.0"?> |