com php-src: Revert "this test is flaky on azure, and can't see why from current output": ext/standard/tests/file/is_file_variation 3.phpt
| From: | Joe Watkins | Date: | Wed, 05 Jun 2019 18:22:44 +0000 |
| Subject: | com php-src: Revert "this test is flaky on azure, and can't see why from current output": ext/standard/tests/file/is_file_variation 3.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106577@lists.php.net to get a copy of this message | ||
Commit: 69f645884947f035034f1af3f3e9e744e51c2004
Author: Joe Watkins <krakjoe@php.net> Wed, 5 Jun 2019 20:22:44 +0200
Parents: 120d3830202100c9da1ed402bedf5cc29d047cd4
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=69f645884947f035034f1af3f3e9e744e51c2004
Log:
Revert "this test is flaky on azure, and can't see why from current output"
This reverts commit 6f9a06cb74421306dc0158b28fa5b4bbb262fd9d.
Changed paths:
M ext/standard/tests/file/is_file_variation3.phpt
Diff:
diff --git a/ext/standard/tests/file/is_file_variation3.phpt
b/ext/standard/tests/file/is_file_variation3.phpt
index 0a06ad5..bee1a6d 100644
--- a/ext/standard/tests/file/is_file_variation3.phpt
+++ b/ext/standard/tests/file/is_file_variation3.phpt
@@ -9,44 +9,51 @@ Test is_file() function: usage variations - invalid filenames
/* Testing is_file() with invalid arguments -int, float, bool, NULL, resource */
-function flatten($variable) {
- \ob_start();
- \var_dump($variable);
- $flattened =
- \ob_get_contents();
- \ob_end_clean();
- return \trim($flattened);
-}
+$file_path = __DIR__;
+$file_handle = fopen($file_path."/is_file_variation3.tmp", "w");
-foreach([
+echo "*** Testing Invalid file types ***\n";
+$filenames = array(
/* Invalid filenames */
-2.34555,
" ",
"",
- true,
- false,
- null,
+ TRUE,
+ FALSE,
+ NULL,
+ $file_handle,
/* scalars */
1234,
- 0,
-
- /* resource */
- fopen(__FILE__, "r")
-] as $filename ) {
- printf(
- "%s: %d\n",
- flatten($filename), @is_file($filename));
+ 0
+);
+
+/* loop through to test each element the above array */
+foreach( $filenames as $filename ) {
+ var_dump( is_file($filename) );
clearstatcache();
}
+fclose($file_handle);
+
+echo "\n*** Done ***";
+?>
+--CLEAN--
+<?php
+$file_path = __DIR__;
+unlink($file_path."/is_file_variation3.tmp");
?>
--EXPECTF--
-float(-2.34555): 0
-string(1) " ": 0
-string(0) "": 0
-bool(true): 0
-bool(false): 0
-NULL: 0
-int(1234): 0
-int(0): 0
-resource(%d) of type (stream): 0
+*** Testing Invalid file types ***
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+
+Warning: is_file() expects parameter 1 to be a valid path, resource given in %s on line %d
+NULL
+bool(false)
+bool(false)
+
+*** Done ***