com php-src: Refactor ftp_append test to clean tempor ary files: ext/ftp/tests/ftp_append.phpt
| From: | Joe Watkins | Date: | Tue, 12 Sep 2017 06:10:22 +0000 |
| Subject: | com php-src: Refactor ftp_append test to clean tempor ary files: ext/ftp/tests/ftp_append.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99369@lists.php.net to get a copy of this message | ||
Commit: 2133b55efd9e36f5fd258d30e6c672d89b8745d7
Author: Michael Paul <michael@michaelpaul.com.br> Sun, 10 Sep 2017 16:16:37 +0100
Committer: Joe Watkins <krakjoe@php.net> Tue, 12 Sep 2017 07:10:22 +0100
Parents: cb62dbe97d7aadb2d165d39d89eefa90e20e50aa
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2133b55efd9e36f5fd258d30e6c672d89b8745d7
Log:
Refactor ftp_append test to clean temporary files
Changed paths:
M ext/ftp/tests/ftp_append.phpt
Diff:
diff --git a/ext/ftp/tests/ftp_append.phpt b/ext/ftp/tests/ftp_append.phpt
index 5f52ac9..ff695c4 100644
--- a/ext/ftp/tests/ftp_append.phpt
+++ b/ext/ftp/tests/ftp_append.phpt
@@ -13,18 +13,28 @@ if (!$ftp) die("Couldn't connect to the server");
var_dump(ftp_login($ftp, 'user', 'pass'));
-@unlink(__DIR__.'/ftp_append_foobar');
+$fooPath = __DIR__ . '/ftp_append_foo';
+file_put_contents($fooPath, 'foo');
+var_dump(ftp_append($ftp, 'ftp_append_foobar', $fooPath, FTP_BINARY));
-file_put_contents(__DIR__.'/ftp_append_foo', 'foo');
-var_dump(ftp_append($ftp, 'ftp_append_foobar', __DIR__.'/ftp_append_foo',
FTP_BINARY));
+$barPath = __DIR__ . '/ftp_append_bar';
+file_put_contents($barPath, 'bar');
+var_dump(ftp_append($ftp, 'ftp_append_foobar', $barPath, FTP_BINARY));
-file_put_contents(__DIR__.'/ftp_append_bar', 'bar');
-var_dump(ftp_append($ftp, 'ftp_append_foobar', __DIR__.'/ftp_append_bar',
FTP_BINARY));
-
-var_dump(file_get_contents(__DIR__.'/ftp_append_foobar'));
+$fooBarPath = __DIR__ . '/ftp_append_foobar';
+var_dump(file_get_contents($fooBarPath));
ftp_close($ftp);
?>
+--CLEAN--
+<?php
+$fooPath = __DIR__ . '/ftp_append_foo';
+unlink($fooPath);
+$barPath = __DIR__ . '/ftp_append_bar';
+unlink($barPath);
+$fooBarPath = __DIR__ . '/ftp_append_foobar';
+unlink($fooBarPath);
+?>
--EXPECTF--
bool(true)
bool(true)