com php-src: split the original test to check behaviour diff on 32- and 64-bit: ext/simplexml/tests/SimpleXMLElement_xpath_1.ph pt
ext/simplexml/tests/SimpleXMLElement_xpath_2.phpt
| From: | Anatol Belski | Date: | Sun, 31 May 2015 19:28:44 +0000 |
| Subject: | com php-src: split the original test to check behaviour diff on 32- and 64-bit: ext/simplexml/tests/SimpleXMLElement_xpath_1.ph pt ext/simplexml/tests/SimpleXMLElement_xpath_2.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87021@lists.php.net to get a copy of this message | ||
Commit: b24fedbd24cef13dab0198f154db4fdaf3c9b3eb
Author: Christoph M. Becker <cmbecker69@gmx.de> Sun, 31 May 2015 21:28:44 +0200
Committer: Anatol Belski <ab@php.net> Sun, 31 May 2015 21:28:44 +0200
Parents: e44b040faf0bf41eaf1b7ff975b460d10fc1b401
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b24fedbd24cef13dab0198f154db4fdaf3c9b3eb
Log:
split the original test to check behaviour diff on 32- and 64-bit
Changed paths:
A ext/simplexml/tests/SimpleXMLElement_xpath_1.phpt
A ext/simplexml/tests/SimpleXMLElement_xpath_2.phpt
Diff:
diff --git a/ext/simplexml/tests/SimpleXMLElement_xpath_1.phpt
b/ext/simplexml/tests/SimpleXMLElement_xpath_1.phpt
new file mode 100644
index 0000000..bf7e031
--- /dev/null
+++ b/ext/simplexml/tests/SimpleXMLElement_xpath_1.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Testing xpath() with invalid XML
+--SKIPIF--
+<?php
+if (PHP_MAJOR_VERSION != 5) die("skip this test is for PHP 5 only");
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only");
+?>
+--FILE--
+<?php
+$xml = simplexml_load_string("XXXXXXX^",$x,0x6000000000000001);
+var_dump($xml->xpath("BBBB"));
+?>
+--EXPECTF--
+Notice: Undefined variable: x in %s on line %d
+
+Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected,
'<' not found in %s on line %d
+
+Warning: simplexml_load_string(): XXXXXXX^ in %s on line %d
+
+Warning: simplexml_load_string(): ^ in %s on line %d
+
+Fatal error: Call to a member function xpath() on a non-object in %s on line %d
diff --git a/ext/simplexml/tests/SimpleXMLElement_xpath_2.phpt
b/ext/simplexml/tests/SimpleXMLElement_xpath_2.phpt
new file mode 100644
index 0000000..78f8b3e
--- /dev/null
+++ b/ext/simplexml/tests/SimpleXMLElement_xpath_2.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Testing xpath() with invalid XML
+--SKIPIF--
+<?php
+if (PHP_MAJOR_VERSION != 5) die("skip this test is for PHP 5 only");
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only");
+?>
+--FILE--
+<?php
+$xml = simplexml_load_string("XXXXXXX^",$x,0x6000000000000001);
+var_dump($xml->xpath("BBBB"));
+?>
+--EXPECTF--
+Notice: Undefined variable: x in %s on line %d
+
+Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected,
'<' not found in %s on line %d
+
+Warning: simplexml_load_string(): XXXXXXX^ in %s on line %d
+
+Warning: simplexml_load_string(): ^ in %s on line %d
+bool(false)
+