Contributing

The following steps are welcome when contributing to our project.

Fork/Clone

First and foremost, create a fork of the repository, and clone it locally. Create a branch on your fork, preferably using a descriptive branch name.

Code/Run

Help improve our project by implementing missing features, adding capabilities, or fixing bugs.

To run the code, simply follow the steps in the installation guide. Grab the keys from the PerimeterX Portal, and try refreshing your page several times continuously. If no default behaviors have been overridden, you should see the PerimeterX block page. Solve the captcha and start fresh again.

Feel free to check out the example app, to have a feel of the project.

Test

Tests for this project are written using PHPUnit.

Don't forget to test. The project relies heavily on tests, thus ensuring each user has the same experience, and no new features break the code. Before you create any pull request, make sure your project has passed all tests, and if any new features require it, write your own.

To run any of the tests in the available suite, first open the bootstrap.php.dist file, and change the values according to the in-file instructions. Then, rename the bootstrap.php.dist to bootstrap.php.

Finally, run the phpunit tests/PerimeterxCookieValidatorTest command to run all tests, or phpunit <testName> to execute a specific test (e.g. phpunit PerimeterxCookieTest)

To run coverage tests, run phpunit --coverage-html tests/coverage. This will create a directory tests/coverage with an html coverage for inspection.

Pull Request

After you have completed this process, create a pull request to the upstream repository. Please provide a complete and thorough description, explaining the changes. Remember, this code has to be read by our maintainers, so keep it simple, smart, and accurate.


Did this page help you?