Skip to content

Commit

Permalink
CI updates (#56)
Browse files Browse the repository at this point in the history
* check for class existence before registering

* add behat.yml

* refactor with wp-cli-tests
  • Loading branch information
aaemnnosttv authored Feb 18, 2019
1 parent 4f14091 commit b9c6021
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
language: php

php:
- 7.3
- 7.2
- 7.1
- 7.0
- 5.6

install: travis_retry composer install

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

script: composer run-behat
script: composer behat

notifications:
email:
Expand Down
4 changes: 4 additions & 0 deletions behat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default:
paths:
features: features
bootstrap: features/bootstrap
2 changes: 1 addition & 1 deletion command.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

use WP_CLI_Valet\ValetCommand;

if (defined('WP_CLI') && WP_CLI) {
if (defined('WP_CLI') && WP_CLI && class_exists(ValetCommand::class)) {
ValetCommand::register();
}
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@
},
"require-dev": {
"aaemnnosttv/wp-sqlite-db": "^1.0",
"behat/behat": "~2.5",
"koodimonni/composer-dropin-installer": "^1.2",
"roave/security-advisories": "dev-master",
"roots/bedrock": "^1.8",
"wp-cli/entity-command": "^1 || ^2",
"wp-cli/eval-command": "^1 || ^2",
"wp-cli/scaffold-package-command": "^0.5.0"
"wp-cli/scaffold-package-command": "^0.5.0",
"wp-cli/wp-cli-tests": "^2.0"
},
"scripts": {
"update-readme": "wp scaffold package-readme . --force",
"run-behat": "behat --ansi"
"behat": "run-behat-tests",
"update-readme": "wp scaffold package-readme . --force"
},
"extra": {
"commands": [
Expand Down

0 comments on commit b9c6021

Please sign in to comment.