summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-08-14 13:08:04 +0200
committerAnatol Belski <ab@php.net>2017-08-14 13:08:04 +0200
commitab07265573b7197af60ff4cf0ebafe6f8615954f (patch)
treea24c8a41d5a920e714bd71bd9bfb1e86965c8637 /ext/standard/tests/file
parent71fd58652f779ec2f7ec784ce3abf1d4a4d27b3d (diff)
downloadphp-git-ab07265573b7197af60ff4cf0ebafe6f8615954f.tar.gz
Test cleanup improvements, files might be locked in the test process
Diffstat (limited to 'ext/standard/tests/file')
-rw-r--r--ext/standard/tests/file/bug65272.phpt8
-rw-r--r--ext/standard/tests/file/fgetss1.phpt7
-rw-r--r--ext/standard/tests/file/flock.phpt6
-rw-r--r--ext/standard/tests/file/fscanf.phpt6
4 files changed, 21 insertions, 6 deletions
diff --git a/ext/standard/tests/file/bug65272.phpt b/ext/standard/tests/file/bug65272.phpt
index 04a5c2d5d5..3a772a8037 100644
--- a/ext/standard/tests/file/bug65272.phpt
+++ b/ext/standard/tests/file/bug65272.phpt
@@ -7,7 +7,7 @@ if (stripos(PHP_OS, 'win') !== 0) die("skip windows required");
--FILE--
<?php
-$file = dirname(__FILE__)."/flock.dat";
+$file = dirname(__FILE__)."/flock_bug65272.dat";
$fp1 = fopen($file, "w");
var_dump(flock($fp1, LOCK_SH));
@@ -16,9 +16,13 @@ $fp2 = fopen($file, "r");
var_dump(flock($fp2, LOCK_EX|LOCK_NB, $wouldblock));
var_dump($wouldblock);
-@unlink($file);
echo "Done\n";
?>
+--CLEAN--
+<?php
+$file = dirname(__FILE__)."/flock_bug65272.dat";
+unlink($file);
+?>
--EXPECTF--
bool(true)
bool(false)
diff --git a/ext/standard/tests/file/fgetss1.phpt b/ext/standard/tests/file/fgetss1.phpt
index 96b8b6f532..58dd00c11a 100644
--- a/ext/standard/tests/file/fgetss1.phpt
+++ b/ext/standard/tests/file/fgetss1.phpt
@@ -29,10 +29,13 @@ foreach ($array as $str) {
var_dump(fgetss($fp, 10, "<script>,<a>"));
}
-@unlink($filename);
-
echo "Done\n";
?>
+--CLEAN--
+<?php
+$filename = dirname(__FILE__)."/fgetss1.html";
+unlink($filename);
+?>
--EXPECTF--
string(21) "askasdfasdf<b>aaaaaa
"
diff --git a/ext/standard/tests/file/flock.phpt b/ext/standard/tests/file/flock.phpt
index 55aae4ab5a..ab08de5256 100644
--- a/ext/standard/tests/file/flock.phpt
+++ b/ext/standard/tests/file/flock.phpt
@@ -33,9 +33,13 @@ var_dump($would);
var_dump(flock($fp, -1));
var_dump(flock($fp, 0));
-@unlink($file);
echo "Done\n";
?>
+--CLEAN--
+<?php
+$file = dirname(__FILE__)."/flock.dat";
+unlink($file);
+?>
--EXPECTF--
Warning: flock() expects at least 2 parameters, 0 given in %s on line %d
NULL
diff --git a/ext/standard/tests/file/fscanf.phpt b/ext/standard/tests/file/fscanf.phpt
index 003dd53dfa..700439fcb5 100644
--- a/ext/standard/tests/file/fscanf.phpt
+++ b/ext/standard/tests/file/fscanf.phpt
@@ -56,9 +56,13 @@ file_put_contents($filename, "data");
$fp = fopen($filename, "rt");
var_dump(fscanf($fp, "%s%d", $v));
-@unlink($filename);
echo "Done\n";
?>
+--CLEAN--
+<?php
+$filename = dirname(__FILE__)."/fscanf.dat";
+unlink($filename);
+?>
--EXPECTF--
Warning: fscanf() expects at least 2 parameters, 0 given in %s on line %d
NULL