Make WordPress Core

Ticket #36083: 36083.diff

File 36083.diff, 980 bytes (added by swissspidy, 9 years ago)
  • new file tests/phpunit/tests/admin/includesUpdateCore.php

    diff --git tests/phpunit/tests/admin/includesUpdateCore.php tests/phpunit/tests/admin/includesUpdateCore.php
    new file mode 100644
    index 0000000..a250483
    - +  
     1<?php
     2
     3/**
     4 * @group admin
     5 * @group upgrade
     6 */
     7class Tests_Admin_IncludesUpdateCore extends WP_UnitTestCase {
     8        public function data_test_old_files_should_not_exist() {
     9                global $_old_files;
     10
     11                require_once( ABSPATH . 'wp-admin/includes/update-core.php' );
     12
     13                foreach ( $_old_files as &$file ) {
     14                        $file = array( $file );
     15                }
     16
     17                return $_old_files;
     18        }
     19
     20        /**
     21         * @dataProvider data_test_old_files_should_not_exist
     22         */
     23        public function test_old_files_should_not_exist( $file ) {
     24                $this->assertFalse( file_exists( ABSPATH . $file ) );
     25                $this->assertFalse( file_exists( ABSPATH . str_replace( '.min.', '.', $file ) ) );
     26                $this->assertFalse( file_exists( ABSPATH . str_replace( '-rtl.min.', '.', $file ) ) );
     27        }
     28}