https://github.com/yukihiko-shinoda/docker-compose-init-phpunit-wordpress-plugin
Docker Compose for init WordPress plugin to start TDD.
https://github.com/yukihiko-shinoda/docker-compose-init-phpunit-wordpress-plugin
docker docker-compose phpunit wordpress-plugin wp-cli wp-plugin
Last synced: about 2 months ago
JSON representation
Docker Compose for init WordPress plugin to start TDD.
- Host: GitHub
- URL: https://github.com/yukihiko-shinoda/docker-compose-init-phpunit-wordpress-plugin
- Owner: yukihiko-shinoda
- Created: 2019-12-17T14:59:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-18T05:03:33.000Z (almost 5 years ago)
- Last Synced: 2025-02-05T07:28:09.283Z (4 months ago)
- Topics: docker, docker-compose, phpunit, wordpress-plugin, wp-cli, wp-plugin
- Language: Dockerfile
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Compose init PHPUnit WordPress plugin
This project supplies environment to init WordPress plugin to start TDD.
[Plugin Unit Tests – WP-CLI — WordPress.org](https://make.wordpress.org/cli/handbook/plugin-unit-tests/#running-tests-on-travis-ci)
You can skip much steps to prepare environment to run WP-CLI.
And you will be able to get files for test with [few steps](#Quickstart).## Requirement
- Docker
- Docker Compose## Quickstart
#### 1. Clone or download
#### 2. Put test target plugin directory into "plugins" directory
#### 3. Enter directory and Docker Compose up (detach)
```shell script
cd docker-compose-init-phpunit-wordpress-plugin
docker-compose up -d
```#### 4. Enter into wordpress container
```shell script
docker exec -it wordpress /bin/bash
```#### 5. Init WordPress temporary
```shell script
wp --allow-root core install --url=localhost --title=temporary --admin_user=admin [email protected]
```#### 6. Generate files for test
```shell script
wp --allow-root scaffold plugin-tests (plugin directory name)
```Then, you'll get files for test.
## References
- [Plugin Unit Tests – WP-CLI — WordPress.org](https://make.wordpress.org/cli/handbook/plugin-unit-tests/)
- [wordpress - Docker Hub](https://hub.docker.com/_/wordpress)