wordpress-develop/tests/phpunit/tests/admin/includesUpdateCore.php
Dominik Schilling (ocean90) 5064747619 Tests: Remove test_new_files_are_not_in_old_files_array() from [36843].
The test assumes that if a CSS file was added to `$_old_files` all three files (.css, .min.css, -rtl.min.css; it's actually missing the fourth case, -rtl.css) don't exist anymore. But this isn't always the case. The test is also incredible slow because it does three `file_exists()` checks for each file — the global contains 646 files currently.

It's important what we have in the /build directory and that's covered by `test_new_files_are_not_in_old_files_array_compiled()`.

Fixes #36083.

git-svn-id: https://develop.svn.wordpress.org/trunk@36885 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-08 16:44:25 +00:00

35 lines
696 B
PHP

<?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` in the build directory.
*
* @ticket 36083
*
* @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 ) );
}
}