Make WordPress Core


Ignore:
Timestamp:
05/28/2024 05:25:06 AM (2 years ago)
Author:
peterwilsoncc
Message:

Build/Test Tools: Assert files exist/do not exist directly.

Replaces various boolean assertions wrapping file_exists() with either assertFileExists() or assertFileDoesNotExist() as appropriate for the test.

Props peterwilsoncc, mukesh27.
See #60705.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/privacy/wpPrivacyDeleteOldExportFiles.php

    r55337 r58221  
    114114                wp_privacy_delete_old_export_files();
    115115
    116                 $this->assertFalse( file_exists( self::$expired_export_file ) );
     116                $this->assertFileDoesNotExist( self::$expired_export_file );
    117117        }
    118118
    … …  
    125125                wp_privacy_delete_old_export_files();
    126126
    127                 $this->assertTrue( file_exists( self::$active_export_file ) );
     127                $this->assertFileExists( self::$active_export_file );
    128128        }
    129129
    … …  
    136136                wp_privacy_delete_old_export_files();
    137137
    138                 $this->assertTrue( file_exists( self::$index_path ) );
     138                $this->assertFileExists( self::$index_path );
    139139        }
    140140
    … …  
    148148
    149149                wp_privacy_delete_old_export_files();
    150                 $this->assertTrue( file_exists( self::$active_export_file ) );
    151                 $this->assertTrue( file_exists( self::$expired_export_file ) );
     150                $this->assertFileExists( self::$active_export_file );
     151                $this->assertFileExists( self::$expired_export_file );
    152152
    153153                remove_filter( 'wp_privacy_export_expiration', array( $this, 'filter_export_file_expiration_time' ) );
Note: See TracChangeset for help on using the changeset viewer.