mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00

* pull-request/320: this is test 5 not 6 fix race condition more shared names that create race conditions change to a unique filename more shared filenames yet another shared filename don't share a filename to stop race conditions fix race condition for 2-4 and normalize names for others fix race condition when running tests in parallel clean up after test Fix #64572: Clean up after the test Fix #64572: Clean up after the test
57 lines
1.1 KiB
PHP
57 lines
1.1 KiB
PHP
--TEST--
|
|
XMLReader: libxml2 XML Reader, setRelaxNGSchema
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("xmlreader")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
/* $Id$ */
|
|
|
|
$xmlstring = '<TEI.2>hello</TEI.2>';
|
|
$relaxngfile = dirname(__FILE__) . '/relaxNG.rng';
|
|
$file = dirname(__FILE__) . '/_007.xml';
|
|
file_put_contents($file, $xmlstring);
|
|
|
|
$reader = new XMLReader();
|
|
$reader->open($file);
|
|
|
|
if ($reader->setRelaxNGSchema($relaxngfile)) {
|
|
while ($reader->read());
|
|
}
|
|
if ($reader->isValid()) {
|
|
print "file relaxNG: ok\n";
|
|
} else {
|
|
print "file relaxNG: failed\n";
|
|
}
|
|
$reader->close();
|
|
unlink($file);
|
|
|
|
|
|
$reader = new XMLReader();
|
|
$reader->XML($xmlstring);
|
|
|
|
if ($reader->setRelaxNGSchema($relaxngfile)) {
|
|
while ($reader->read());
|
|
}
|
|
if ($reader->isValid()) {
|
|
print "string relaxNG: ok\n";
|
|
} else {
|
|
print "string relaxNG: failed\n";
|
|
}
|
|
|
|
$reader->close();
|
|
|
|
$reader = new XMLReader();
|
|
$reader->XML($xmlstring);
|
|
|
|
if ($reader->setRelaxNGSchema('')) {
|
|
echo 'failed';
|
|
}
|
|
$reader->close();
|
|
?>
|
|
===DONE===
|
|
--EXPECTF--
|
|
file relaxNG: ok
|
|
string relaxNG: ok
|
|
|
|
Warning: XMLReader::setRelaxNGSchema(): Schema data source is required in %s on line %d
|
|
===DONE===
|