From 7e5f54d5eff4b84f2e9d2618150ac5aaa715735a Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 26 Sep 2015 22:03:53 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/pluggable.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/phpunit/tests/pluggable.php b/tests/phpunit/tests/pluggable.php index b8efdb59dd..31f4be7935 100644 --- a/tests/phpunit/tests/pluggable.php +++ b/tests/phpunit/tests/pluggable.php @@ -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(), + ); }