Make WordPress Core


Ignore:
Timestamp:
09/25/2022 04:47:02 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Revert removing empty directory in WP_UnitTestCase_Base::rmdir() for now.

This appears to need more investigation. Instead, delete the test-plugin and link-manager directories in REST API plugins controller tests, for which this change was initially intended.

Follow-up to [54300], [54301], [54303].

See #55652, #56629.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/abstract-testcase.php

    r54303 r54304  
    13511351     *
    13521352     * @since 4.0.0
    1353      * @since 6.1.0 Removes the empty directory if there are no files left.
    13541353     *
    13551354     * @param string $path Directory path.
    13561355     */
    13571356    public function rmdir( $path ) {
    1358         if ( ! is_dir( $path ) ) {
    1359             return;
    1360         }
    1361 
    13621357        $files = $this->files_in_dir( $path );
    13631358        foreach ( $files as $file ) {
     
    13651360                $this->unlink( $file );
    13661361            }
    1367         }
    1368 
    1369         /*
    1370          * If there were no ignored files, remove the empty directory.
    1371          * If there are any nested empty directories, remove them too.
    1372          */
    1373         if ( ! array_intersect( $files, self::$ignore_files ) ) {
    1374             $this->delete_folders( $path );
    13751362        }
    13761363    }
Note: See TracChangeset for help on using the changeset viewer.