Download the PHP package stephenharris/wordpress-behat-extension without Composer
On this page you can find all versions of the php package stephenharris/wordpress-behat-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stephenharris/wordpress-behat-extension
More information about stephenharris/wordpress-behat-extension
Files in stephenharris/wordpress-behat-extension
Package wordpress-behat-extension
Short Description WordPress extension for Behat 3
License MIT
Informations about the package wordpress-behat-extension
WordPress Extension for Behat 3
This is a Behat 3.0 Extension for WordPress plugin and theme development.
The Extension allows you to use WordPress functions in your context class if you include StephenHarris\WordPressBehatExtension\Context\WordPressContext
(or create and include a child class of it, i.e. make your FeatureContext
).
It also provides other contexts.
Version: 0.4.0 . This project follows SemVer.
History
This repository started off as a fork of:
- https://github.com/JohnBillion/WordPressBehatExtension
- itself a fork of https://github.com/tmf/WordPressExtension
- itself a fork of https://github.com/wdalmut/WordPressExtension
Installation
(For 'quick start' guides, please see the Recipes).
-
Add a composer development requirement for your WordPress theme or plugin:
You don't have to install WordPress via composer. But you shall need a path to a WordPress install below. Additionally you don't have to use the Goutte and Selenium2 drivers, but these are the most common.
-
Add the following Behat configuration file below. You will need:
- The path to your WordPress install (here assumed
vendor/wordpress
, relative to your project's root directory). - The database, and database username and password of your WordPress install (here assumed
wordress_test
,root
,''
) - The URL of your WordPress install (In this example we'll be using php's build in server)
- A temporary directory to store e-mails that are 'sent'
Note the
StephenHarris\WordPressBehatExtension\Context\WordPressContext
context included. This will cause WordPress to be loaded, and all its functions available in your context classes.. You can also include other contexts. - The path to your WordPress install (here assumed
-
Install the vendors and initialize behat test suites
-
Write some Behat features in your project's
features
directory and define any steps. TheWordPressContext
context will make all WordPress functions available in your context classes (but there is a better way). -
Run the tests
In our example, since we using PHP's built-in web sever, this will need to be started so that Behat can access our site.
Documentation
Please see the Docs.
Aim
The aim of this project is to provide a collection of context classes that allow for easy testing of WordPress' core functionality. Those contexts can then be built upon to test your site/plugin/theme-specific functionality.
License
WordPressBehatExtension is open source and released under MIT license. See LICENSE file for more info.
Health Warning
This is not to be used on a live site. Your database will be cleared of all data.
Currently this extension also over-rides your wp-config.php
but this implementation may change in the future.
The extension installs three mu-plugins
into your install (which it assumes is at {site-path}/wp-content/mu-plugins
). These plug-ins do the following:
wp-mail.php
- over-rideswp_mail()
function to store the e-mails locallywp-install.php
- over-rideswp_install_defaults()
to prevent any default content being created, with the exception of the 'Uncategorised' category.move-admin-bar-to-back.php
- a workaround for #1 which prevent elements from being hidden from Selenium behind the admin menu bar.
Changelog
A changelog can be found at CHANGELOG.md.
How to help
This project needs a lot of love :). You can help by doing any of the following
- Opening an issue to request a context / step definitions
- Submitting a PR to add a context / step definition
- Submiting a PR to add to or improve the documentation
- Opening an issue you have questions or find any bugs
- Just using this extension in your development / testing workflow and providing your feedback
All versions of wordpress-behat-extension with dependencies
behat/mink-extension Version ~2.0@dev
symfony/filesystem Version ~2.3
symfony/finder Version ~2.3
phpunit/phpunit Version >=4.8.0
sensiolabs/behat-page-object-extension Version ^2.0
myclabs/php-enum Version ^1.5