mirror of
git://develop.git.wordpress.org/
synced 2025-02-25 00:52:55 +01:00
Add function signature tests for the pluggable functions in wp-admin/includes/schema.php and wp-admin/includes/upgrade.php.
See #33867 git-svn-id: https://develop.svn.wordpress.org/trunk@34608 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4196a0751c
commit
7e5f54d5ef
@ -74,12 +74,28 @@ class Tests_Pluggable extends WP_UnitTestCase {
|
||||
*/
|
||||
public function getDefinedPluggableFunctions() {
|
||||
|
||||
require_once ABSPATH . '/wp-admin/includes/upgrade.php';
|
||||
|
||||
$test_functions = array(
|
||||
'install_network',
|
||||
'wp_install',
|
||||
'wp_install_defaults',
|
||||
'wp_new_blog_notification',
|
||||
'wp_upgrade',
|
||||
'install_global_terms',
|
||||
);
|
||||
$test_files = array(
|
||||
'wp-includes/pluggable.php',
|
||||
'wp-includes/cache.php',
|
||||
);
|
||||
$data = array();
|
||||
|
||||
foreach ( $test_functions as $function ) {
|
||||
$data[] = array(
|
||||
$function
|
||||
);
|
||||
}
|
||||
|
||||
foreach ( $test_files as $file ) {
|
||||
preg_match_all( '#^function (\w+)#m', file_get_contents( ABSPATH . '/' . $file ), $functions );
|
||||
|
||||
@ -160,6 +176,16 @@ class Tests_Pluggable extends WP_UnitTestCase {
|
||||
'wp_cache_add_non_persistent_groups' => array( 'groups' ),
|
||||
'wp_cache_reset' => array(),
|
||||
|
||||
// wp-admin/includes/schema.php:
|
||||
'install_network' => array(),
|
||||
|
||||
// wp-admin/includes/upgrade.php:
|
||||
'wp_install' => array( 'blog_title', 'user_name', 'user_email', 'public', 'deprecated' => '', 'user_password' => '', 'language' => '' ),
|
||||
'wp_install_defaults' => array( 'user_id' ),
|
||||
'wp_new_blog_notification' => array( 'blog_title', 'blog_url', 'user_id', 'password' ),
|
||||
'wp_upgrade' => array(),
|
||||
'install_global_terms' => array(),
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user