mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Move tests for ms_files_rewriting to separate group, ms-files
When the `ms_files_rewriting` flag is enabled, `ms_upload_constants()` is required to properly set upload directory constants. Once this fires, it is impossible to clean up for a non `ms_files_rewriting` test by turning the option back off. Excluding these tests by default offer a more consistent environment overall. Any tests written for uploaded files in multisite should ideally have a correspondign test in this area. This commit also moves existing `ms_files_rewriting` tests for `test_switch_upload_dir()`. Fixes #30256 git-svn-id: https://develop.svn.wordpress.org/trunk@30286 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -129,10 +129,12 @@ class WP_PHPUnit_Util_Getopt extends PHPUnit_Util_Getopt {
|
||||
}
|
||||
|
||||
$ajax_message = true;
|
||||
$ms_files_message = true;
|
||||
foreach ( $options as $option ) {
|
||||
switch ( $option[0] ) {
|
||||
case '--exclude-group' :
|
||||
$ajax_message = false;
|
||||
$ms_files_message = false;
|
||||
continue 2;
|
||||
case '--group' :
|
||||
$groups = explode( ',', $option[1] );
|
||||
@@ -142,12 +144,16 @@ class WP_PHPUnit_Util_Getopt extends PHPUnit_Util_Getopt {
|
||||
}
|
||||
}
|
||||
$ajax_message = ! in_array( 'ajax', $groups );
|
||||
$ms_files_message = ! in_array( 'ms-files', $groups );
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
if ( $ajax_message ) {
|
||||
echo "Not running ajax tests... To execute these, use --group ajax." . PHP_EOL;
|
||||
}
|
||||
if ( $ms_files_message ) {
|
||||
echo "Not running ms_files_rewriting tests... To execute these, use --group ms-files." . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
new WP_PHPUnit_Util_Getopt( $_SERVER['argv'] );
|
||||
|
||||
Reference in New Issue
Block a user