Make WordPress Core

Changeset 39173


Ignore:
Timestamp:
11/08/2016 11:49:11 PM (8 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Utilise assertFileExists() and assertFileNotExists() in more places.

See #38716

Location:
trunk/tests/phpunit/tests
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/includesUpdateCore.php

    r36885 r39173  
    3030     */
    3131    public function test_new_files_are_not_in_old_files_array_compiled( $file ) {
    32         $this->assertFalse( file_exists( dirname( ABSPATH ) . '/build/' . $file ) );
     32        $this->assertFileNotExists( dirname( ABSPATH ) . '/build/' . $file );
    3333    }
    3434}
  • trunk/tests/phpunit/tests/ajax/MediaEdit.php

    r38113 r39173  
    9595
    9696        foreach ( $files_that_shouldnt_exist as $file ) {
    97             $this->assertFalse( file_exists( $file ), 'IMAGE_EDIT_OVERWRITE is leaving garbage image files behind.' );
     97            $this->assertFileNotExists( $file, 'IMAGE_EDIT_OVERWRITE is leaving garbage image files behind.' );
    9898        }
    9999    }
  • trunk/tests/phpunit/tests/dependencies/backbonejs.php

    r37723 r39173  
    99    function test_exclusion_of_sourcemaps() {
    1010        $file = ABSPATH . WPINC . '/js/backbone.min.js';
    11         $this->assertTrue( file_exists( $file ) );
     11        $this->assertFileExists( $file );
    1212        $contents = trim( file_get_contents( $file ) );
    1313        $this->assertFalse( strpos( $contents, 'sourceMappingURL' ), 'Presence of sourceMappingURL' );
  • trunk/tests/phpunit/tests/multisite/ms-files-rewriting.php

    r38762 r39173  
    7777
    7878        // The file on the main site should still exist. The file on the deleted site should not.
    79         $this->assertTrue( file_exists( $file1['file'] ) );
    80         $this->assertFalse( file_exists( $file2['file'] ) );
     79        $this->assertFileExists( $file1['file'] );
     80        $this->assertFileNotExists( $file2['file'] );
    8181
    8282        wpmu_delete_blog( $blog_id, true );
    8383
    8484        // The file on the main site should still exist. The file on the deleted site should not.
    85         $this->assertTrue( file_exists( $file1['file'] ) );
    86         $this->assertFalse( file_exists( $file2['file'] ) );
     85        $this->assertFileExists( $file1['file'] );
     86        $this->assertFileNotExists( $file2['file'] );
    8787    }
    8888}
  • trunk/tests/phpunit/tests/multisite/site.php

    r38935 r39173  
    286286
    287287        // The file on the main site should still exist. The file on the deleted site should not.
    288         $this->assertTrue( file_exists( $file1['file'] ) );
    289         $this->assertFalse( file_exists( $file2['file'] ) );
     288        $this->assertFileExists( $file1['file'] );
     289        $this->assertFileNotExists( $file2['file'] );
    290290
    291291        wpmu_delete_blog( $blog_id, true );
    292292
    293293        // The file on the main site should still exist. The file on the deleted site should not.
    294         $this->assertTrue( file_exists( $file1['file'] ) );
    295         $this->assertFalse( file_exists( $file2['file'] ) );
     294        $this->assertFileExists( $file1['file'] );
     295        $this->assertFileNotExists( $file2['file'] );
    296296    }
    297297
  • trunk/tests/phpunit/tests/theme.php

    r39065 r39173  
    211211        $this->assertNotEmpty( $wp_theme->get('License') );
    212212        $path_to_style_css = $wp_theme->get_theme_root() . '/' . $wp_theme->get_stylesheet() . '/style.css';
    213         $this->assertTrue( file_exists( $path_to_style_css ) );
     213        $this->assertFileExists( $path_to_style_css );
    214214        $theme_data = get_theme_data( $path_to_style_css );
    215215        $this->assertArrayHasKey( 'License', $theme_data );
  • trunk/tests/phpunit/tests/theme/themeDir.php

    r39170 r39173  
    247247        @mkdir( WP_CONTENT_DIR . '/themes/foo-themes' );
    248248
    249         $this->assertTrue( file_exists( WP_CONTENT_DIR . '/themes/foo' ) );
    250         $this->assertTrue( file_exists( WP_CONTENT_DIR . '/themes/foo-themes') );
     249        $this->assertFileExists( WP_CONTENT_DIR . '/themes/foo' );
     250        $this->assertFileExists( WP_CONTENT_DIR . '/themes/foo-themes' );
    251251
    252252        register_theme_directory( '/' );
Note: See TracChangeset for help on using the changeset viewer.