]> granicus.if.org Git - php/commitdiff
MFB51: Fixed tests to work with ZTS builds
authorIlia Alshanetsky <iliaa@php.net>
Thu, 20 Oct 2005 19:22:55 +0000 (19:22 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 20 Oct 2005 19:22:55 +0000 (19:22 +0000)
ext/dom/tests/dom_xinclude.phpt
ext/zlib/tests/compress_zlib_wrapper.phpt

index 92df048bc550b5d3ba356264854ef7b877bbdfdf..f9a3dd761ede6a6a62b4296d6319cbbecd59fc67 100644 (file)
@@ -8,20 +8,25 @@ array_search('compress.zlib', stream_get_wrappers()) or die('skip compress.zlib
 --FILE--
 <?php
 $dom = new domdocument;
-$dom->load(dirname(__FILE__)."/xinclude.xml");
+
+$data = file_get_contents(dirname(__FILE__)."/xinclude.xml");
+$data = str_replace('compress.zlib://ext/dom/tests/','compress.zlib://'.dirname(__FILE__).'/', $data);
+
+$dom->loadXML($data);
+
 $dom->xinclude();
 print $dom->saveXML()."\n";
 foreach ($dom->documentElement->childNodes as $node) {
        print $node->nodeName."\n";
 }
-
---EXPECT--
+?>
+--EXPECTF--
 <?xml version="1.0"?>
 <foo xmlns:xi="http://www.w3.org/2001/XInclude">
-    <book xml:base="compress.zlib://ext/dom/tests/book.xml">
+    <book xml:base="compress.zlib://%sext/dom/tests/book.xml">
   <title>The Grapes of Wrath</title>
   <author>John Steinbeck</author>
- </book><book xml:base="compress.zlib://ext/dom/tests/book.xml">
+ </book><book xml:base="compress.zlib://%sext/dom/tests/book.xml">
   <title>The Pearl</title>
   <author>John Steinbeck</author>
  </book>
index 4bed91a1238588c82a1f36f917e43011e1902b50..de6b3d80b91bcfba3576fd059bb6441a379512b0 100644 (file)
@@ -3,8 +3,10 @@ compress.zlib:// wrapper
 --FILE--
 <?php
 
+$pfx = str_repeat('../', substr_count($_SERVER['PHP_SELF'], '../'));
+
 // Relative path
-$fp = fopen("compress.zlib://ext/xsl/tests/xslt.xsl.gz", "rb");
+$fp = fopen("compress.zlib://{$pfx}ext/xsl/tests/xslt.xsl.gz", "rb");
 fclose($fp);
 
 // Absolute path