Skip to content

Commit cd5572c

Browse files
Merge pull request #2 from danielbachhuber/wp-cli-v2
Update test suite to use WP-CLI v2
2 parents 906dc61 + 8bda8e0 commit cd5572c

File tree

14 files changed

+50
-3478
lines changed

14 files changed

+50
-3478
lines changed

.travis.yml

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ sudo: false
22
dist: trusty
33

44
language: php
5+
php: 7.2
56

67
notifications:
78
email:
@@ -21,19 +22,6 @@ env:
2122
- PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH"
2223
- WP_CLI_BIN_DIR="$TRAVIS_BUILD_DIR/vendor/bin"
2324

24-
matrix:
25-
include:
26-
- php: 7.2
27-
env: WP_VERSION=latest
28-
- php: 7.1
29-
env: WP_VERSION=latest
30-
- php: 7.0
31-
env: WP_VERSION=latest
32-
- php: 5.6
33-
env: WP_VERSION=latest
34-
- php: 5.6
35-
env: WP_VERSION=3.7.11
36-
3725
before_install:
3826
- |
3927
# Remove Xdebug for a huge performance increase:
@@ -45,14 +33,38 @@ before_install:
4533
- |
4634
# Raise PHP memory limit to 2048MB
4735
echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
36+
- composer validate
4837

4938
install:
50-
- composer require wp-cli/wp-cli:dev-master
5139
- composer install
52-
- bash bin/install-package-tests.sh
53-
54-
before_script:
55-
- composer validate
40+
- composer prepare-tests
5641

5742
script:
58-
- bash bin/test.sh
43+
- composer phpunit
44+
- composer behat
45+
46+
jobs:
47+
include:
48+
- stage: sniff
49+
script:
50+
# - composer lint
51+
- composer phpcs
52+
env: BUILD=sniff
53+
- stage: test
54+
php: 7.2
55+
env: WP_VERSION=latest
56+
- stage: test
57+
php: 7.1
58+
env: WP_VERSION=latest
59+
- stage: test
60+
php: 7.0
61+
env: WP_VERSION=latest
62+
- stage: test
63+
php: 5.6
64+
env: WP_VERSION=latest
65+
- stage: test
66+
php: 5.6
67+
env: WP_VERSION=3.7.11
68+
- stage: test
69+
php: 5.4
70+
env: WP_VERSION=latest

bin/install-package-tests.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

bin/test.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

composer.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,27 @@
1414
"files": [ "command.php" ]
1515
},
1616
"require": {
17-
"wp-cli/wp-cli": "^1.1.0"
17+
"wp-cli/wp-cli": "^2"
1818
},
1919
"require-dev": {
20-
"behat/behat": "~2.5"
20+
"behat/behat": "~2.5",
21+
"wp-cli/wp-cli-tests": "^2",
22+
"wp-cli/extension-command": "^2",
23+
"wp-cli/core-command": "^2",
24+
"wp-cli/checksum-command": "^2"
25+
},
26+
"scripts": {
27+
"lint": "run-linter-tests",
28+
"phpcs": "run-phpcs-tests",
29+
"phpunit": "run-php-unit-tests",
30+
"behat": "run-behat-tests",
31+
"prepare-tests": "install-package-tests",
32+
"test": [
33+
"@lint",
34+
"@phpcs",
35+
"@phpunit",
36+
"@behat"
37+
]
2138
},
2239
"extra": {
2340
"commands": [ "reinstall" ]

0 commit comments

Comments
 (0)