File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
tests/phpunit/tests/filesystem/wpFilesystemDirect Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -252,13 +252,13 @@ public function owner( $file ) {
252252 * @since 2.5.0
253253 *
254254 * @param string $file Path to the file.
255- * @return string|false Mode of the file (the last 3 digits), false on failure.
255+ * @return string Mode of the file (the last 3 digits), or the string "0" on failure.
256256 */
257257 public function getchmod ( $ file ) {
258258 $ perms = @fileperms ( $ file );
259259
260260 if ( false === $ perms ) {
261- return false ;
261+ return ' 0 ' ;
262262 }
263263
264264 return substr ( decoct ( $ perms ), -3 );
Original file line number Diff line number Diff line change @@ -33,16 +33,16 @@ public function test_should_get_chmod_for_a_path_that_exists( $path ) {
3333
3434 /**
3535 * Tests that `WP_Filesystem_Direct::getchmod()` returns
36- * false for a path that does not exist.
36+ * "0" for a path that does not exist.
3737 *
3838 * @dataProvider data_paths_that_do_not_exist
3939 *
4040 * @ticket 57774
4141 *
4242 * @param string $path The path.
4343 */
44- public function test_should_return_false_for_a_path_that_does_not_exist ( $ path ) {
44+ public function test_should_return_zero_for_a_path_that_does_not_exist ( $ path ) {
4545 $ actual = self ::$ filesystem ->getchmod ( self ::$ file_structure ['test_dir ' ]['path ' ] . $ path );
46- $ this ->assertFalse ( $ actual );
46+ $ this ->assertSame ( ' 0 ' , $ actual );
4747 }
4848}
You can’t perform that action at this time.
0 commit comments