Giter Site home page Giter Site logo

example-plugin's Introduction

Example Plugin

Build Status

A complete example for using WP PHPUnit in the context of plugin development.

Features

Travis CI Configuration

A ready to use .travis.yml configured with a reasonable test matrix

  • Includes all currently supported versions of PHP (7.4 and 8.0) and the current WP minimum required PHP 5.6
  • Tests against the latest version of WordPress, as well as an older version (4.9) although it could be easily extended to include multiple older versions, multisite, etc.

Just Add Tests

This project includes a working example test-example.php test case. Adding tests is as simple as adding methods to this example class! Getting up and running couldn't be easier.

Local Development

Install Composer dependencies

$ composer install

Create a database for your tests to use and update your tests/wp-config.php as necessary.

$ mysqladmin create wp_phpunit_tests -u root

The database name defaults to wp_phpunit_tests, but you can change this in the tests/wp-config.php without affecting the Travis configuration which is environment variable-based.

Run the tests

$ composer test

example-plugin's People

Contributors

aaemnnosttv avatar nasirnobin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.