Download the PHP package alperakgun/wp_nock without Composer
On this page you can find all versions of the php package alperakgun/wp_nock. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alperakgun/wp_nock
More information about alperakgun/wp_nock
Files in alperakgun/wp_nock
Package wp_nock
Short Description WP_Http server mocking library for PHP/WordPress
License GPL-2.0-or-later
Informations about the package wp_nock
wp_nock
WP_Http server mocking library for PHP/WordPress inspired by the nock JavaScript library.
Usage
You can install wp_nock as a development composer package dependencies.
Require it in your tests/bootstrap.php
Using PHPUnit, you can test any code which uses
- WP_Http classes such as wp_remote_get, wp_remote_request,wp_remote_post.
- Or wp_redirect, wp_safe_redirect etc.
Testing the wp_redirect requires a callback
Another way of testing the wp_redirect requires an exception
Contributing
We welcome contributions. Please don’t hesitate to send a pull request, send a suggestion, file a bug, or just ask a question. We promise we’ll be nice.
For PHP, we use PHP Code Sniffer with the WordPress coding standards.
Testing
We like tests :) Make sure you run them before starting out!
PHP unit tests can be run with:
We’re Here To Help
We encourage you to ask for help at any point. We want your first experience with wp_nock to be a good one, so don’t be shy. If you’re wondering why something is the way it is, or how a decision was made, you can tag issues with [Type] Question or prefix them with “Question:”.
License
wp_nock is licensed under GNU General Public License v2 (or later).
All materials contributed should be compatible with the GPLv2. This means that if you own the material, you agree to license it under the GPLv2 license. If you are contributing code that is not your own, such as adding a component from another Open Source project, or adding an npm
package, you need to make sure you follow these steps:
- Check that the code has a license. If you can't find one, you can try to contact the original author and get permission to use, or ask them to release under a compatible Open Source license.
- Check the license is compatible with GPLv2, note that the Apache 2.0 license is not compatible.