2017 © Pedro Peláez
 

library wp_wrapper

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

image

mrkoopie/wp_wrapper

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  • Friday, May 20, 2016
  • by dkoop
  • Repository
  • 1 Watchers
  • 0 Stars
  • 205 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

WP_wrapper

Total Downloads Latest Stable Version Build status https://travis-ci.org/MrKoopie/WP_wrapper.svg?branch=master, (*1)

By default WordPress has many non-mockable functions such as register_taxonomy(). By implementing this wrapper you can create tests that use mocks instead of a real WordPress installation., (*2)

How to install

  1. Go to the root directory of your theme/plugin.
  2. Run the following command:
composer require mrkoopie/wp_wrapper
  1. Include the composer autoloader in your script (for a theme the functions.php).
require_once('vendor/autoload.php');

How to use the wrapper

Simply include this in the top of your file:, (*3)

use MrKoopie/WP_wrapper/WP_wrapper;

Now you can run any command (including any PHP command) via the wrapper:, (*4)

echo WP_wrapper::print_r('Y',1);

Do I always have to use the use feature?

Simply use this code to make the class available without the namespace. Do note that this may cause conflicts when an other class exists with the name WP_wrapper., (*5)

require_once('vendor/autoload.php');

class WP_wrapper extends MrKoopie/WP_wrapper/WP_Wrapper {};

The Versions

20/05 2016

dev-analysis-8KoR56

dev-analysis-8KoR56

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  Sources   Download

MIT

The Development Requires

by Daniel Koop

08/04 2016

v1.2.4

1.2.4.0

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  Sources   Download

MIT

The Development Requires

by Daniel Koop

08/04 2016

v1.2.3

1.2.3.0

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  Sources   Download

MIT

The Development Requires

by Daniel Koop

19/03 2016

dev-master

9999999-dev

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  Sources   Download

MIT

The Development Requires

by Daniel Koop

19/03 2016

v1.2.2

1.2.2.0

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  Sources   Download

MIT

The Development Requires

by Daniel Koop

19/03 2016

dev-dev

dev-dev

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  Sources   Download

MIT

The Development Requires

by Daniel Koop

19/03 2016

v1.2.1

1.2.1.0

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  Sources   Download

MIT

The Development Requires

by Daniel Koop

19/03 2016

v1.1.0

1.1.0.0

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  Sources   Download

MIT

The Development Requires

by Daniel Koop

19/03 2016

v1.0.2

1.0.2.0

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  Sources   Download

MIT

The Development Requires

by Daniel Koop

19/03 2016

v1.0.1

1.0.1.0

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  Sources   Download

MIT

The Development Requires

by Daniel Koop

19/03 2016

v1.0.0

1.0.0.0

Wraps WordPress functions into mockable objects. Used for WP_ajaxfilter.

  Sources   Download

MIT

The Development Requires

by Daniel Koop