zoe Thu Jan 22 22:04:34 2009 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/file fopen_variation16.phpt
fopen_variation12.phpt
Log:
fixed test
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fopen_variation16.phpt?r1=1.1.4.3&r2=1.1.4.4&diff_format=u
Index: php-src/ext/standard/tests/file/fopen_variation16.phpt
diff -u php-src/ext/standard/tests/file/fopen_variation16.phpt:1.1.4.3
php-src/ext/standard/tests/file/fopen_variation16.phpt:1.1.4.4
--- php-src/ext/standard/tests/file/fopen_variation16.phpt:1.1.4.3 Wed Dec
3 12:38:32 2008
+++ php-src/ext/standard/tests/file/fopen_variation16.phpt Thu Jan 22
22:04:34 2009
@@ -2,8 +2,6 @@
Test fopen() function : variation: use include path create and read a file
(relative)
--CREDITS--
Dave Kelsey <[email protected]>
---XFAIL--
-Bug #46680
--FILE--
<?php
/* Prototype : resource fopen(string filename, string mode [, bool
use_include_path [, resource context]])
@@ -14,7 +12,6 @@
require_once('fopen_include_path.inc');
-echo "*** Testing fopen() : variation ***\n";
$thisTestDir = "fopenVariation16.dir";
mkdir($thisTestDir);
chdir($thisTestDir);
@@ -22,6 +19,7 @@
$newpath = create_include_path();
set_include_path($newpath);
runtest();
+
$newpath = generate_next_path();
set_include_path($newpath);
runtest();
@@ -37,13 +35,15 @@
$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 @@
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===
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fopen_variation12.phpt?r1=1.1.4.3&r2=1.1.4.4&diff_format=u
Index: php-src/ext/standard/tests/file/fopen_variation12.phpt
diff -u php-src/ext/standard/tests/file/fopen_variation12.phpt:1.1.4.3
php-src/ext/standard/tests/file/fopen_variation12.phpt:1.1.4.4
--- php-src/ext/standard/tests/file/fopen_variation12.phpt:1.1.4.3 Wed Dec
3 12:38:32 2008
+++ php-src/ext/standard/tests/file/fopen_variation12.phpt Thu Jan 22
22:04:34 2009
@@ -2,8 +2,6 @@
Test fopen() function : variation: use include path (path is bad) create a
file (relative)
--CREDITS--
Dave Kelsey <[email protected]>
---XFAIL--
-Bug #46680
--FILE--
<?php
/* Prototype : resource fopen(string filename, string mode [, bool
use_include_path [, resource context]])
@@ -12,16 +10,15 @@
* 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 @@
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 @@
?>
===DONE===
--EXPECT--
-*** Testing fopen() : variation ***
-Not created in working dir
-created in script dir
+created in working dir
+Not created in script dir
===DONE===
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php