2017 © Pedro Peláez
 

library wp-test-suite

Run WordPress test easy

image

frozzare/wp-test-suite

Run WordPress test easy

  • Tuesday, October 17, 2017
  • by fredrikforsmo
  • Repository
  • 2 Watchers
  • 13 Stars
  • 16,419 Installations
  • PHP
  • 26 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 26 Versions
  • 3 % Grown

The README.md

WordPress Test Suite

Build Status No Maintenance Intended, (*1)

Instead of adding a boostrap.php to every plugin you do you can just install this package and point to the bootstrap.php. For small plugins this should be enough. If you require something more advanced this isn't the package for your project., (*2)

Install

composer require frozzare/wp-test-suite

Example

Example .travis.yml:, (*3)

language: php

php:
  - 5.4
  - 5.5
  - 5.6

env:
  - WP_VERSION=latest WP_MULTISITE=0

install:
  - travis_retry composer install --no-interaction --prefer-source

before_script:
  - bash vendor/frozzare/wp-test-suite/bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 $WP_VERSION

script: vendor/bin/phpunit

Example phpunit.xml.dist:, (*4)

<phpunit
  bootstrap="vendor/frozzare/wp-test-suite/bootstrap.php"
  backupGlobals="false"
  colors="true"
  convertErrorsToExceptions="true"
  convertNoticesToExceptions="true"
  convertWarningsToExceptions="true"
  >
  <php>
    <const name="WTS_PLUGIN_FILE_NAME" value="simple-gtm.php" />
  </php>
  <testsuites>
    <testsuite name="Simple GTM Test Suite">
      <directory suffix=".php">./tests/</directory>
    </testsuite>
  </testsuites>
  <logging>
    <log type="coverage-clover" target="./tmp/clover.xml" charset="UTF-8" />
  </logging>
</phpunit>

Example of using your own tests/boostrap.php with WordPress Test Suite:, (*5)

require __DIR__ . '/../vendor/autoload.php';

WP_Test_Suite::load_plugins( [
  __DIR__ . '/../simple-gtm.php'
] );

WP_Test_Suite::run();

Documentation

Without a bootstrap.php

install-wp-tests.sh

This package include install-wp-tests.sh and the path is:, (*6)

vendor/frozzare/wp-test-suite/bin/install-wp-tests.sh
WTS_PLUGIN_FILE_NAME

With this constant you don't have to create your own boostrap.php. Just include WTS_PLUGIN_FILE_NAME const in your phpunit.xml.dist with the plugin file name that should be loaded., (*7)

With a bootstrap.php

WP_Test_Suite::load_plugins

A array of plugin paths or a string of a plugin path to load., (*8)

WP_Test_Suite::load_files

A array of file paths or a string of a file path to load., (*9)

WP_Test_Suite::set_test_root

Set a new test root path. It will try to autoload from: - WP_DEVELOP_DIR/tests/phpunit - /tmp/wordpress-develop/tests/phpunit - /tmp/wordpress-tests-lib - /srv/www/wordpress-develop/tests/phpunit - /srv/www/wordpress-develop/public_html/tests/phpunit, (*10)

License

MIT © Fredrik Forsmo, (*11)

The Versions

17/10 2017

dev-master

9999999-dev

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

17/10 2017

dev-frozzare-patch-1-1

dev-frozzare-patch-1-1

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

17/10 2017

dev-frozzare-patch-1

dev-frozzare-patch-1

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

24/02 2017

v1.1.1

1.1.1.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

10/11 2016

v1.1.0

1.1.0.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

19/08 2016

v1.0.20

1.0.20.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

08/02 2016

v1.0.19

1.0.19.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

03/02 2016

v1.0.18

1.0.18.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

08/01 2016

v1.0.17

1.0.17.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

10/10 2015

v1.0.16

1.0.16.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

06/10 2015

v1.0.15

1.0.15.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

19/09 2015

v1.0.14

1.0.14.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

19/09 2015

v1.0.13

1.0.13.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

19/09 2015

v1.0.12

1.0.12.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

17/09 2015

v1.0.11

1.0.11.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

17/09 2015

v1.0.10

1.0.10.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

07/09 2015

v1.0.9

1.0.9.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

07/09 2015

v1.0.8

1.0.8.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

27/07 2015

v1.0.7

1.0.7.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

22/05 2015

v1.0.6

1.0.6.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

14/05 2015

v1.0.5

1.0.5.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

 

wordpress test easy suite

14/05 2015

v1.0.4

1.0.4.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

  • php >=5.3

 

wordpress test easy suite

26/04 2015

v1.0.3

1.0.3.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

  • php >=5.3

 

wordpress test easy suite

16/04 2015

v1.0.2

1.0.2.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

  • php >=5.3

 

wordpress test easy suite

14/04 2015

v1.0.1

1.0.1.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

  • php >=5.3

 

wordpress test easy suite

14/04 2015

v1.0.0

1.0.0.0

Run WordPress test easy

  Sources   Download

MIT

The Requires

  • php >=5.3

 

wordpress test easy suite