Skip to content

Commit ec2e8cd

Browse files
authored
Merge pull request #60 from wpengine/local-testing
Fix local testing and update tests
2 parents 551a6a4 + 98f13b7 commit ec2e8cd

14 files changed

+1368
-606
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@ PLUGIN_NAME := wpengine-geoip
55

66
# Shortcuts
77
DOCKER_RUN := docker run --rm -v `pwd`:/workspace
8-
WP_TEST_IMAGE := worldpeaceio/wordpress-integration:5.2-php7.2
8+
WP_TEST_IMAGE := test-image
99
COMPOSER_IMAGE := -v `pwd`:/app -v ~/.composer/cache:/tmp/cache:delegated composer
1010
DEPLOY_IMAGE := wp-deploy
1111
DEPLOY_ENV_VARS = -e SVN_USERNAME -e SVN_PASSWORD -e SLUG="$(PLUGIN_NAME)" -e VERSION="$(shell make get_version)" -e DEPLOY
1212
VENDOR_BIN_DIR := /workspace/vendor/bin
1313
BUILD_DIR := ./build
1414

1515
# Commands
16-
all: composer_install lint test
16+
all: composer_install build-test lint test
1717

1818
shell:
1919
$(DOCKER_RUN) -it --entrypoint "/bin/bash" $(WP_TEST_IMAGE)
2020

2121
composer_install:
2222
$(DOCKER_RUN) $(COMPOSER_IMAGE) install
2323

24+
build-test:
25+
docker build \
26+
--file ./test/Dockerfile.integration \
27+
--tag $(WP_TEST_IMAGE) \
28+
.
29+
2430
lint:
2531
$(DOCKER_RUN) --entrypoint "$(VENDOR_BIN_DIR)/phpcs" $(WP_TEST_IMAGE) src
2632

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@
77
"require-dev": {
88
"squizlabs/php_codesniffer": "^3.4",
99
"phpcompatibility/php-compatibility": "^9.3",
10-
"phpunit/phpunit": "^7.5",
10+
"phpunit/phpunit": "^9.6.21",
1111
"wp-coding-standards/wpcs": "^2.1",
12-
"dealerdirect/phpcodesniffer-composer-installer": "^0.5"
12+
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
13+
"yoast/phpunit-polyfills": "^3.0"
14+
},
15+
"config": {
16+
"allow-plugins": {
17+
"dealerdirect/phpcodesniffer-composer-installer": true
18+
}
1319
}
1420
}

0 commit comments

Comments
 (0)