Coder Social home page Coder Social logo

yukihiko-shinoda / docker-compose-phpunit-wordpress-plugin Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 26 KB

Docker Compose for PHPUnit for WordPress plugin.

License: GNU General Public License v3.0

wordpress wordpress-plugin wordpress-development phpunit phpcs visual-studio-code vscode remote-development remote-development-container wp wp-plugin wordpress-plugin-development docker docker-compose

docker-compose-phpunit-wordpress-plugin's Introduction

💻PHPUnit Environment for WordPress Plugin🌐

docker build automated? docker build passing? image size and number of layers Twitter URL

Supplies PHPUnit environment built acording to official document on WordPress.org.

Contents:

Benefit

🛠️Use for backend development

This environment provides following tools:

  • PHPUnit
  • Mockery
  • PHP_CodeSniffer

And also can work with Visual Studio Code. You can lint your code on editor in real time.

🎈Easy to prepare

You can skip much steps to prepare environment. And you will be able to start Unit Test for WordPres plugin with only few steps.

✨Clean for PC

You don't need to install any SDKs in your PC without only few requirements. You will be free from regular maintenance for development environment.

Requirement

  • Docker
  • Docker Compose

Optional

Quickstart

With Visual Studio Code (Recommend)

Tutorial with screenshot are available on the Wiki.

Without Visual Studio Code

If you want to use other editor or IDE, you also can use this environment only for running PHPUnit or PHP_CodeSniffer.

1. Clone or download

git clone https://github.com/yukihiko-shinoda/docker-compose-phpunit-wordpress-plugin.git

2. Set environment variables

Copy .env.dist to .env.

copy .env.dist .env

Edit .env to set PATH_TO_INDIVIDUAL_PLUGIN_DIRECTORY.

Ex:

PATH_TO_INDIVIDUAL_PLUGIN_DIRECTORY=../plugins/staticpress2019
# DOCKER_IMAGE_PHPUNIT=futureys/phpunit-wordpress-plugin:4.3.22-php7.1.33-apache-buster
# MYSQL_VERSION=5.6

3. Execute Docker Compose run

docker-compose run phpunit

And then, you can execute PHPUnit and PHP_CodeSniffer.

phpunit
phpcs

Out of scope

UI test is not available by this environment.

docker-compose-phpunit-wordpress-plugin's People

Contributors

yukihiko-shinoda avatar

Watchers

 avatar  avatar

docker-compose-phpunit-wordpress-plugin's Issues

Error: The container name "/database" is already in use by container

This is a very useful image. Thank you.

Sometimes when I start it, I get an error like this ERROR: for database Cannot create container for service database: Conflict. The container name "/database" is already in use by container "88314d275e3321b1e97b0de1a657da5f18f9722b5261f850d397d912b456ced3". You have to remove (or rename) that contai ner to be able to reuse that name.

I am then able to remove that container -- docker rm 88314d275e3321b1e97b0de1a657da5f18f9722b5261f850d397d912b456ced3 -- and start over and everything is fine. So, not a huge deal, but possible bug or maybe I'm wrong.

My docker-compose

version: '3.7'
services:
  database:
    container_name: database
    environment:
      MYSQL_ROOT_PASSWORD: examplepass
    image: mysql:5.7

  phpunit:
    command:
      - bash
    container_name: phpunit
    depends_on:
      - database
    environment:
      DATABASE_PASSWORD: examplepass
    image: futureys/phpunit-wordpress-plugin
    stdin_open: true
    tty: true
    volumes:
      - .:/plugin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.