2017 © Pedro Peláez
 

library module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

image

wordpoints/module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

  • Thursday, December 1, 2016
  • by jdgrimes
  • Repository
  • 1 Watchers
  • 0 Stars
  • 368 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

WordPoints Module Uninstall Tester

A testcase class for testing WordPoints module install and uninstall, with related tools., (*1)

Background

This repo is an extension of the WP Plugin Uninstall Tester, which enables it for use with WordPoints modules. For more information about the purpose and use of it, see that repo., (*2)

Requirements

The WP Plugin Uninstall Tester is required, and must be included in your bootstrap before you include this extension's files. It will be installed for you automatically if you are using composer., (*3)

Compatibility

The library is intended to be compatible with the current stable version of the WordPoints plugin, as well as the bleeding edge development version. It should also be compatible with all versions of PHP and WordPress which those versions of WordPoints support., (*4)

Installation

You can install this library with composer:, (*5)

composer require --dev wordpoints/module-uninstall-tester:~0.2

Set Up

You need to modify your tests' boostrap file to only include the module when the uninstall tests aren't being run., (*6)

/*
 * This needs to go after you include WordPress's unit test functions, but before
 * loading WordPress's bootstrap.php file.
 */

// Include the plugin uninstall test tools functions.
include_once dirname( __FILE__ ) . '/../../vendor/jdgrimes/wp-plugin-uninstall-tester/includes/functions.php';

// Now include the module uninstall test tools functions.
include_once dirname( __FILE__ ) . '/../../vendor/wordpoints/module-uninstall-tester/functions.php';

// Check if the tests are running. Only load the plugin if they aren't.
if ( ! running_wordpoints_module_uninstall_tests() ) {
    tests_add_filter( 'muplugins_loaded', 'my_plugin_activate' );
}

Secondly, you need to include the bootstrap.php file:, (*7)

/*
 * This needs to be included after loading WordPress's bootstrap.php, because the
 * uninstall testcase extends WordPress's WP_UnitTestCase class.
 */

// Include the plugin uninstall tools bootstrap.
include_once dirname( __FILE__ ) . '/../../vendor/jdgrimes/wp-plugin-uninstall-tester/bootstrap.php';

// Now include the module uninstall tools bootstrap.
include_once dirname( __FILE__ ) . '/../../vendor/wordpoints/module-uninstall-tester/bootstrap.php';

Thirdly, you need to exclude the uninstall group from the tests in your PHPUnit XML config file:, (*8)

    <!-- This needs to go inside of the <phpunit></phpunit> tags -->
    <groups>
        <exclude>
            <group>uninstall</group>
        </exclude>
    </groups>

That will exclude the uninstall tests from running by default. To run them, you'll need to do phpunit --group=uninstall., (*9)

Finally, you will need to set WORDPOINTS_TESTS_DIR in your environment. This should be the full path to the /tests/phpunit/ directory in the WordPoints plugin development source., (*10)

Example:, (*11)

export WORDPOINTS_TESTS_DIR=/path/to/wordpoints/tests/phpunit/, (*12)

Usage

The only difference in usage from the plugin uninstall test tools, is that the path to the main module file is stored in the $module_file property, instead of $plugin_file., (*13)

License

This library is joint licensed under the MIT and GPLv2 licenses., (*14)

The Versions

01/12 2016

dev-develop

dev-develop https://github.com/WordPoints/wordpoints-module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

  Sources   Download

MIT

The Requires

 

27/07 2016

dev-master

9999999-dev https://github.com/WordPoints/wordpoints-module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

  Sources   Download

MIT

The Requires

 

27/07 2016

0.4.0

0.4.0.0 https://github.com/WordPoints/wordpoints-module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

  Sources   Download

MIT

The Requires

 

24/07 2016

0.3.0

0.3.0.0 https://github.com/WordPoints/wordpoints-module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

  Sources   Download

MIT

The Requires

 

25/06 2015

0.2.4

0.2.4.0 https://github.com/WordPoints/wordpoints-module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

  Sources   Download

MIT

The Requires

 

25/06 2015

0.2.3

0.2.3.0 https://github.com/WordPoints/wordpoints-module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

  Sources   Download

MIT

The Requires

 

02/01 2015

0.2.2

0.2.2.0 https://github.com/WordPoints/wordpoints-module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

  Sources   Download

MIT

The Requires

 

31/12 2014

0.2.1

0.2.1.0 https://github.com/WordPoints/wordpoints-module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

  Sources   Download

MIT

The Requires

 

02/09 2014

0.2.0

0.2.0.0 https://github.com/WordPoints/wordpoints-module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

  Sources   Download

MIT

The Requires

 

29/08 2014

0.1.1

0.1.1.0 https://github.com/WordPoints/wordpoints-module-uninstall-tester

Utilities for testing WordPoints module install/uninstall with PHPUnit

  Sources   Download

MIT

The Requires