The necessary steps and commands for testing the Gitium plugin: how to create a testing environment, how to run the tests, how to build your own WordPress local environment using docker.

Build the docker image

cd test-env
docker build -t gitiumtest .

Run the docker image and associate the code with /code dir

cd gitium
docker run -it -v `pwd`:/code gitiumtest

Start the env for tests

make clean ; make env_latest

Run the tests

reset ; ./vendor/bin/phpunit --tap

Run only one suite (clean run)

make clean ; make env_latest ; reset ; ./vendor/bin/phpunit --tap tests/test-git-wrapper.php

Run only the methods with test_is_dirty

reset ; ./vendor/bin/phpunit --tap tests/test-git-wrapper.php --filter '/test_is_dirty/'

Build your own WordPress local environment using docker (mywordpressdocker)

cd test-env

The result should look similar to this:

Go to: in order to install a new WordPress site.

Go inside of mywordpressdocker

docker exec -it $(docker ps -a | grep mywordpressdocker | cut -d' ' -f1) bash

View the logs inside of mywordpressdocker

docker logs -f $(docker ps -a | grep mywordpressdocker | cut -d' ' -f1)
docker logs -f $(docker ps -a | grep mywordpressdocker | cut -d' ' -f1) 2>&1 | grep 'PHP error'

Connect to MySQL from docker

docker exec -it $(docker ps -a | grep mysqldocker | cut -d' ' -f1) bash
mysql --user=root --password=my-secret-pw --database=wordpress

See Also

Gitfs Arguments

Gitfs can be customized and configured through a list of arguments, which we've described and [...]

Gitium Frequently Asked Questions

A selection of frequently asked questions regarding Gitium.

How to use Gitfs

Here you will find all the commands necessary to install and configure Gitfs, as well as a [...]

Install Gitium

Gitium can be installed and activated like any other WordPress plugin.