Skip to content

Commit b9c6021

Browse files
authored
CI updates (#56)
* check for class existence before registering * add behat.yml * refactor with wp-cli-tests
1 parent 4f14091 commit b9c6021

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
language: php
22

33
php:
4+
- 7.3
45
- 7.2
56
- 7.1
6-
- 7.0
7-
- 5.6
87

98
install: travis_retry composer install
109

@@ -13,7 +12,7 @@ before_script:
1312
- mysql -e 'CREATE DATABASE wp_cli_test;' -uroot
1413
- mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost" IDENTIFIED BY "password1"' -uroot
1514

16-
script: composer run-behat
15+
script: composer behat
1716

1817
notifications:
1918
email:

behat.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
default:
2+
paths:
3+
features: features
4+
bootstrap: features/bootstrap

command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
use WP_CLI_Valet\ValetCommand;
44

5-
if (defined('WP_CLI') && WP_CLI) {
5+
if (defined('WP_CLI') && WP_CLI && class_exists(ValetCommand::class)) {
66
ValetCommand::register();
77
}

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,17 @@
3434
},
3535
"require-dev": {
3636
"aaemnnosttv/wp-sqlite-db": "^1.0",
37-
"behat/behat": "~2.5",
3837
"koodimonni/composer-dropin-installer": "^1.2",
38+
"roave/security-advisories": "dev-master",
3939
"roots/bedrock": "^1.8",
4040
"wp-cli/entity-command": "^1 || ^2",
4141
"wp-cli/eval-command": "^1 || ^2",
42-
"wp-cli/scaffold-package-command": "^0.5.0"
42+
"wp-cli/scaffold-package-command": "^0.5.0",
43+
"wp-cli/wp-cli-tests": "^2.0"
4344
},
4445
"scripts": {
45-
"update-readme": "wp scaffold package-readme . --force",
46-
"run-behat": "behat --ansi"
46+
"behat": "run-behat-tests",
47+
"update-readme": "wp scaffold package-readme . --force"
4748
},
4849
"extra": {
4950
"commands": [

0 commit comments

Comments
 (0)