summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/resources/reset-temp-file.php
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/http/tests/resources/reset-temp-file.php')
-rwxr-xr-xLayoutTests/http/tests/resources/reset-temp-file.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/resources/reset-temp-file.php b/LayoutTests/http/tests/resources/reset-temp-file.php
new file mode 100755
index 0000000..186376b
--- /dev/null
+++ b/LayoutTests/http/tests/resources/reset-temp-file.php
@@ -0,0 +1,19 @@
+<?php
+require_once 'portabilityLayer.php';
+
+if (!sys_get_temp_dir()) {
+ echo "FAIL: No temp dir was returned.\n";
+ exit();
+}
+
+$tmpFile = sys_get_temp_dir() . "/" . $_GET['filename'];
+
+if (!file_put_contents($tmpFile, "test")) {
+ echo "FAIL: unable to write to file: " . $tmpFile . "\n";
+ exit();
+}
+if (!unlink($tmpFile)) {
+ echo "FAIL: Unable to delete file: " . $tmpFile . "\n";
+ exit();
+}
+?>