Comment out some CSS files in $_old_files
that were added back as a result of [36341].
Add a unit test to make sure the `$_old_files` array does not contain any current project files. Props joemcgill, swissspidy. Fixes #36083. git-svn-id: https://develop.svn.wordpress.org/trunk@36843 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
43399f4ff7
commit
fb7ada9e9a
@ -598,9 +598,10 @@ $_old_files = array(
|
||||
'wp-admin/css/colors.min.css',
|
||||
'wp-admin/css/colors-rtl.css',
|
||||
'wp-admin/css/colors-rtl.min.css',
|
||||
'wp-admin/css/media-rtl.min.css',
|
||||
'wp-admin/css/media.min.css',
|
||||
'wp-admin/css/farbtastic-rtl.min.css',
|
||||
// Following files added back in 4.5 see #36083
|
||||
// 'wp-admin/css/media-rtl.min.css',
|
||||
// 'wp-admin/css/media.min.css',
|
||||
// 'wp-admin/css/farbtastic-rtl.min.css',
|
||||
'wp-admin/images/lock-2x.png',
|
||||
'wp-admin/images/lock.png',
|
||||
'wp-admin/js/theme-preview.js',
|
||||
|
53
tests/phpunit/tests/admin/includesUpdateCore.php
Normal file
53
tests/phpunit/tests/admin/includesUpdateCore.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @group admin
|
||||
* @group upgrade
|
||||
*/
|
||||
class Tests_Admin_IncludesUpdateCore extends WP_UnitTestCase {
|
||||
public function data_old_files() {
|
||||
global $_old_files;
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/includes/update-core.php' );
|
||||
|
||||
$files = $_old_files;
|
||||
|
||||
foreach ( $files as &$file ) {
|
||||
$file = array( $file );
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure no project files are inside `$_old_files`.
|
||||
*
|
||||
* @ticket 36083
|
||||
*
|
||||
* @dataProvider data_old_files
|
||||
*
|
||||
* @param string $file File name.
|
||||
*/
|
||||
public function test_new_files_are_not_in_old_files_array( $file ) {
|
||||
$this->assertFalse( file_exists( ABSPATH . $file ) );
|
||||
$this->assertFalse( file_exists( ABSPATH . str_replace( '.min.', '.', $file ) ) );
|
||||
$this->assertFalse( file_exists( ABSPATH . str_replace( '-rtl.min.', '.', $file ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure no project files are inside `$_old_files` in the build directory.
|
||||
*
|
||||
* The previous test confirms that no existing files are inside `$_old_files`.
|
||||
* However, we must also confirm that these do not exist in the final build.
|
||||
*
|
||||
* @ticket 36083
|
||||
*
|
||||
* @depends test_new_files_are_not_in_old_files_array
|
||||
* @dataProvider data_old_files
|
||||
*
|
||||
* @param string $file File name.
|
||||
*/
|
||||
public function test_new_files_are_not_in_old_files_array_compiled( $file ) {
|
||||
$this->assertFalse( file_exists( dirname( ABSPATH ) . '/build/' . $file ) );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user