Skip to content

Commit 79df7dc

Browse files
committed
prep for feature tests
1 parent 7360b11 commit 79df7dc

15 files changed

+1930
-0
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
composer.lock
3+
wp-cli.local.yml
4+
node_modules/
5+
vendor/
6+
composer.phar
7+
installer

.travis.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
sudo: false
2+
3+
language: php
4+
5+
notifications:
6+
email:
7+
on_success: never
8+
on_failure: change
9+
10+
branches:
11+
only:
12+
- master
13+
14+
php:
15+
- 5.3
16+
- 5.6
17+
18+
cache:
19+
- composer
20+
- $HOME/.composer/cache
21+
22+
env:
23+
global:
24+
- WP_CLI_BIN_DIR=/tmp/wp-cli-phar
25+
26+
before_script:
27+
- bash bin/install-package-tests.sh
28+
29+
script: ./vendor/bin/behat

bin/install-package-tests.sh

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
PACKAGE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )"
6+
7+
download() {
8+
if [ `which curl` ]; then
9+
curl -s "$1" > "$2";
10+
elif [ `which wget` ]; then
11+
wget -nv -O "$2" "$1"
12+
fi
13+
}
14+
15+
install_wp_cli() {
16+
17+
# the Behat test suite will pick up the executable found in $WP_CLI_BIN_DIR
18+
mkdir -p $WP_CLI_BIN_DIR
19+
download https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar $WP_CLI_BIN_DIR/wp
20+
chmod +x $WP_CLI_BIN_DIR/wp
21+
22+
}
23+
24+
download_behat() {
25+
26+
cd $PACKAGE_DIR
27+
download https://getcomposer.org/installer installer
28+
php installer
29+
php composer.phar require --dev behat/behat='~2.5'
30+
31+
}
32+
33+
install_db() {
34+
mysql -e 'CREATE DATABASE IF NOT EXISTS wp_cli_test;' -uroot
35+
mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost" IDENTIFIED BY "password1"' -uroot
36+
}
37+
38+
install_wp_cli
39+
download_behat
40+
install_db

composer.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "trepmal/wp-revisions-cli",
3+
"description": "Manage revisions",
4+
"homepage": "https://github.com/trepmal/wp-revisions-cli",
5+
"license": "MIT",
6+
"require": {
7+
"php": ">=5.3"
8+
},
9+
"autoload": {
10+
"files": [ "revisions-cli.php" ]
11+
},
12+
"require-dev": {
13+
"behat/behat": "~2.5"
14+
}
15+
}

0 commit comments

Comments
 (0)