Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 28, 2023. It is now read-only.

A template for a Wordpress plugin with tests that are running using Docker

License

NotificationsYou must be signed in to change notification settings

Soluto/wordpress-plugin-tests-template

Repository files navigation

This repository is no longer maintained and has been archived. Feel free to browse the code, but please migrate to other solutions.

wordpress-plugin-tests-template

Wordpress plugin development is easy, but when it come to testing things can get complicated pretty fast.Wordpress CLI can generate all that is required to write integration tests for your plugin, with live Wordpress environment.But to run those tests you need to have PHP and MySql on your machine, which is not always the case.This sound like really good used case fordocker anddocker-compose - we can create the relevant images and run them easily on any machine that has Docker.This also mean that the same version of PHP and MySql that run on your machine, also run on the CI, and you can easily target various PHP/Wordpress versions.To learn more about this template in thisblog post

Features

  • Support hot-reloading

How to run the tests?

  • docker-compose up --build -d
  • docker-compose run wordpress vendor/bin/phpunit

And watch the tests running.To clean up, run:docker-compose down.

Changes in the plugin code or the tests will be hot-reloaded, no need to runbuild command again.

How to use this template?

  • Fork/Clone this repo
  • Replace the plugin code undersrc folder.
  • Opentests\bootstrap.php and change the plugin name (look for theTODO).
  • Write some tests under thetests folder.
  • Add relevant libraries for your tests to thecomposer.json file.
  • Don't forget to follow this repo, so you will receive updates.

About

A template for a Wordpress plugin with tests that are running using Docker

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp