Skip to content

Latest commit

 

History

History
83 lines (58 loc) · 3.07 KB

contributing.md

File metadata and controls

83 lines (58 loc) · 3.07 KB

Wp Tide Test Plugin Contributing Guide

Before submitting your contribution, please make sure to take a moment and read through the following guidelines.

Issue Reporting Guidelines

  • The issue list of this repo is exclusively for bug reports and feature requests.
  • Try to search for your issue, it may have already been answered or even fixed in the wip (Work in Progress) branch.
  • Check if the issue is reproducible with the latest stable version. If you are using a pre-release, please indicate the specific version you are using.
  • It is required that you clearly describe the steps necessary to reproduce the issue you are running into. Issues without clear reproducible steps will be closed immediately.
  • If your issue is resolved but still open, don't hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.

Pull Request Guidelines

  • Checkout a topic branch from wip and merge back against wip.
  • DO NOT check-in the build directory with your commits.
  • Follow the WordPress Coding Standards.
  • Make sure the default grunt task passes. (see development setup)
  • If adding a new feature:
    • Add accompanying test case.
    • Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it green-lit before working on it.
  • If fixing a bug:
    • Provide detailed description of the bug in the PR. Live demo preferred.
    • Add appropriate test coverage if applicable.

Development Setup

You will need Node.js, Grunt, & PHPUnit installed on your system. To run the unit tests you must be developing within the WordPress Core. The simplest method to get a testing environment up is by using Varying Vagrant Vagrants. However, if you are using MAMP then the following command will clone trunk.

To clone the WordPress Core

$ git clone https://github.com/xwp/wordpress-develop.git

To clone this repository

$ git clone --recursive [email protected]:xwp/wp-wp-tide-test-plugin.git wp-tide-test-plugin

To install packages

# npm install -g grunt-cli
$ npm install

To lint:

$ grunt jshint

To check the text domain:

$ grunt checktextdomain

To create a pot file:

$ grunt makepot

The default task (simply running grunt) will do the following: jshint -> checktextdomain.

PHPUnit Testing

Run tests:

$ phpunit

Run tests with an HTML coverage report:

$ phpunit --coverage-html /tmp/report

Travis CI will run the unit tests and perform sniffs against the WordPress Coding Standards whenever you push changes to your PR. Tests are required to pass successfully for a merge to be considered.