com php-src: Add tests to XMLReader::expand error paths: ext/xmlreader/tests/expand_error.phpt

From: Date: Thu, 19 Oct 2017 10:55:31 +0000
Subject: com php-src: Add tests to XMLReader::expand error paths: ext/xmlreader/tests/expand_error.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-99801@lists.php.net to get a copy of this message
Commit: 4c97dc099c6c9499e6fdd8c2b4c125f3cfcdb7d6 Author: Thiago Carvalho <thiago.oak@gmail.com> Wed, 11 Oct 2017 08:53:13 +0200 Committer: Joe Watkins <krakjoe@php.net> Thu, 19 Oct 2017 11:55:31 +0100 Parents: 847f0701100c13f2a2c2779790bd17a2b93ee5e0 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4c97dc099c6c9499e6fdd8c2b4c125f3cfcdb7d6 Log: Add tests to XMLReader::expand error paths Changed paths: A ext/xmlreader/tests/expand_error.phpt Diff: diff --git a/ext/xmlreader/tests/expand_error.phpt b/ext/xmlreader/tests/expand_error.phpt new file mode 100644 index 0000000..4b27993 --- /dev/null +++ b/ext/xmlreader/tests/expand_error.phpt @@ -0,0 +1,29 @@ +--TEST-- +XMLReader: Expand Error +--SKIPIF-- +<?php if (!extension_loaded("xmlreader")) print "skip"; +if (!extension_loaded("dom")) print "skip DOM extension required"; +$reader = new XMLReader(); +if (!method_exists($reader, 'expand')) print "skip"; +?> +--FILE-- +<?php + +$xmlstring = '<?xml version="1.0" encoding="UTF-8"?> +<books><book>new book</book></books>'; + +$reader = new XMLReader(); +var_dump($reader->expand()); +$reader->close(); + +$reader = new XMLReader(); +$reader->XML($xmlstring); +var_dump($reader->expand()); +$reader->close(); +?> +--EXPECTF-- +Warning: XMLReader::expand(): Load Data before trying to expand in %s on line %d +bool(false) + +Warning: XMLReader::expand(): An Error Occurred while expanding in %s on line %d +bool(false) \ No newline at end of file

« previous php.cvs (#99801) next »