Skip to content

Commit

Permalink
Don't hook install function directly
Browse files Browse the repository at this point in the history
This is cheating for the plugin, and might not catch issues with how
the function is hooked up.

Fixes #13
  • Loading branch information
JDGrimes committed Sep 26, 2015
1 parent 0a5d9b5 commit 24b807a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,6 @@ class My_Plugin_Uninstall_Test extends WP_Plugin_Uninstall_UnitTestCase {
*/
protected $plugin_file;

/**
* The plugin's install function.
*
* @type callable $install_function
*/
protected $install_function = 'my_plugin_activate';

//
// Public methods.
//
Expand Down
9 changes: 3 additions & 6 deletions bin/install-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
*/

$plugin_file = $argv[1];
$install_function = $argv[2];
$config_file_path = $argv[3];
$is_multisite = $argv[4];
$config_file_path = $argv[2];
$is_multisite = $argv[3];

require dirname( __FILE__ ) . '/bootstrap.php';

require $plugin_file;

add_action( 'activate_' . $plugin_file, $install_function );

do_action( 'activate_' . $plugin_file, false );
do_action( 'activate_' . plugin_basename( $plugin_file ), false );
10 changes: 0 additions & 10 deletions includes/wp-plugin-uninstall-unittestcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ abstract class WP_Plugin_Uninstall_UnitTestCase extends WP_UnitTestCase {
*/
protected $plugin_file;

/**
* The plugin's install function.
*
* @since 0.1.0
*
* @type callable $install_function
*/
protected $install_function;

/**
* The plugin's uninstall function (if it has one).
*
Expand Down Expand Up @@ -164,7 +155,6 @@ protected function install() {
WP_PHP_BINARY
. ' ' . escapeshellarg( dirname( dirname( __FILE__ ) ) . '/bin/install-plugin.php' )
. ' ' . escapeshellarg( $this->plugin_file )
. ' ' . escapeshellarg( $this->install_function )
. ' ' . escapeshellarg( $this->locate_wp_tests_config() )
. ' ' . (int) is_multisite()
);
Expand Down

0 comments on commit 24b807a

Please sign in to comment.