summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoe Slattery <zoe@php.net>2009-01-22 22:04:34 +0000
committerZoe Slattery <zoe@php.net>2009-01-22 22:04:34 +0000
commit62c51d8d2d65bd07c70c149d27ab0a72045f3ca7 (patch)
tree4dcbd7160136740d51d09ece7cbdae62c0165012
parent074b08485201dc3af205a76ea609d53050ec8229 (diff)
downloadphp-git-62c51d8d2d65bd07c70c149d27ab0a72045f3ca7.tar.gz
fixed test
-rw-r--r--ext/standard/tests/file/fopen_variation12.phpt15
-rw-r--r--ext/standard/tests/file/fopen_variation16.phpt24
2 files changed, 18 insertions, 21 deletions
diff --git a/ext/standard/tests/file/fopen_variation12.phpt b/ext/standard/tests/file/fopen_variation12.phpt
index 10d18189c7..9df4490236 100644
--- a/ext/standard/tests/file/fopen_variation12.phpt
+++ b/ext/standard/tests/file/fopen_variation12.phpt
@@ -2,8 +2,6 @@
Test fopen() function : variation: use include path (path is bad) create a file (relative)
--CREDITS--
Dave Kelsey <d_kelsey@uk.ibm.com>
---XFAIL--
-Bug #46680
--FILE--
<?php
/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
@@ -12,16 +10,15 @@ Bug #46680
* Alias to functions:
*/
-echo "*** Testing fopen() : variation ***\n";
set_include_path("rubbish");
testme();
restore_include_path();
function testme() {
- $tmpfile = 'fopen_variation12.tmp';
+ $tmpfile = basename(__FILE__, ".php") . ".tmp";
$h = fopen($tmpfile, "w", true);
- fwrite($h, "This is the test file");
+ fwrite($h, (binary) "This is the test file");
fclose($h);
@@ -35,8 +32,9 @@ function testme() {
unlink($tmpfile);
}
+
$scriptDirFile = dirname(__FILE__).'/'.$tmpfile;
- $h = fopen($scriptDirFile, "r");
+ $h = @fopen($scriptDirFile, "r");
if ($h === false) {
echo "Not created in script dir\n";
}
@@ -49,7 +47,6 @@ function testme() {
?>
===DONE===
--EXPECT--
-*** Testing fopen() : variation ***
-Not created in working dir
-created in script dir
+created in working dir
+Not created in script dir
===DONE===
diff --git a/ext/standard/tests/file/fopen_variation16.phpt b/ext/standard/tests/file/fopen_variation16.phpt
index 059098ff57..3f220aa7c0 100644
--- a/ext/standard/tests/file/fopen_variation16.phpt
+++ b/ext/standard/tests/file/fopen_variation16.phpt
@@ -2,8 +2,6 @@
Test fopen() function : variation: use include path create and read a file (relative)
--CREDITS--
Dave Kelsey <d_kelsey@uk.ibm.com>
---XFAIL--
-Bug #46680
--FILE--
<?php
/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
@@ -14,7 +12,6 @@ Bug #46680
require_once('fopen_include_path.inc');
-echo "*** Testing fopen() : variation ***\n";
$thisTestDir = "fopenVariation16.dir";
mkdir($thisTestDir);
chdir($thisTestDir);
@@ -22,6 +19,7 @@ chdir($thisTestDir);
$newpath = create_include_path();
set_include_path($newpath);
runtest();
+
$newpath = generate_next_path();
set_include_path($newpath);
runtest();
@@ -37,13 +35,15 @@ function runtest() {
$extraDir = "extraDir";
mkdir($dir1.'/'.$extraDir);
+ mkdir($extraDir);
$tmpfile = $extraDir.'/fopen_variation16.tmp';
+
$h = fopen($tmpfile, "w+", true);
- fwrite($h, "This is the test file");
+ fwrite($h, (binary) "This is the test file");
fclose($h);
- $h = fopen($dir1.'/'.$tmpfile, "r");
+ $h = @fopen($dir1.'/'.$tmpfile, "r");
if ($h === false) {
echo "Not created in dir1\n";
}
@@ -57,19 +57,19 @@ function runtest() {
echo "could not find file for reading\n";
}
else {
- echo "found file again in dir1\n";
+ echo "found file - not in dir1\n";
fclose($h);
}
- unlink($dir1.'/'.$tmpfile);
+ unlink($tmpfile);
rmdir($dir1.'/'.$extraDir);
+ rmdir($extraDir);
}
?>
===DONE===
--EXPECT--
-*** Testing fopen() : variation ***
-created in dir1
-found file again in dir1
-created in dir1
-found file again in dir1
+Not created in dir1
+found file - not in dir1
+Not created in dir1
+found file - not in dir1
===DONE===