Download the PHP package iambrianreich/wordpress-testcase without Composer
On this page you can find all versions of the php package iambrianreich/wordpress-testcase. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download iambrianreich/wordpress-testcase
More information about iambrianreich/wordpress-testcase
Files in iambrianreich/wordpress-testcase
Package wordpress-testcase
Short Description PHPUnit extensions to make testing WordPress extensions easier.
License MIT
Informations about the package wordpress-testcase
iambrianreich/wordpress-testcase
This project provides a custom TestCase
class and Constraints
that
make unit testing PHP extensions with PHPUnit simpler.
This project is meant to work in conjuction with the WP-CLI Instructions on setting up PHPUnit Testing for WordPress it does not replace or supercede them.
Installation
composer require iambrianreich/wordpress-testcase
Usage
You can either use the Constraint
classes defined in this project directly or
extend BR\WordPress\TestCase\PHPUnit\TestCase
, which exposes the constraints
through assert*()
methods that allow you to easily validate your extensions
integrations with WordPress.
Credits
Credit where it's due:
- PLugin Integration Tests | WP-CLI: The official source material that explains how to setup your plugin for unit testing with PHPUnit. Without this foundation this project is useless.
- r/ProWordPress: The folks on the ProWordPress subreddit were incredibly helpful when I reached out and asked how they're doing unit testing.
License
MIT License
Copyright (c) 2023 Brian Reich
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
All versions of wordpress-testcase with dependencies
phpunit/phpunit Version ^9.6
squizlabs/php_codesniffer Version 3.*
yoast/phpunit-polyfills Version ^1.0