Skip to content

Commit d8f52b1

Browse files
committed
Merge branch 'develop'
2 parents 8234aab + fc8b558 commit d8f52b1

13 files changed

+805
-768
lines changed

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ env:
88
- TEST_COMMAND=$(echo $TRAVIS_REPO_SLUG | cut -d/ -f 2) # Get command name to be tested
99

1010
before_script:
11+
- sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
1112
- |
1213
# Remove Xdebug for a huge performance increase:
1314
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
@@ -33,3 +34,8 @@ notifications:
3334
email:
3435
on_success: never
3536
on_failure: change
37+
38+
addons:
39+
apt:
40+
packages:
41+
- docker-ce

ci/prepare.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@ rm ee
1010
cd ..
1111
git clone https://github.com/EasyEngine/easyengine.git easyengine --depth=1
1212
cd easyengine
13-
echo 'travis_test' > VERSION
1413

1514
# Copy tests to EE repo
1615
rm -r features
1716
cp -R ../$TEST_COMMAND/features .
1817

18+
# Update repo branches
19+
if [[ "$TRAVIS_BRANCH" != "master" ]]; then
20+
sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json
21+
fi
22+
1923
# Install composer dependencies and update them for tests
2024
composer update
2125

2226
# Place the command inside EE repo
23-
sudo rm -r vendor/easyengine/$TEST_COMMAND
27+
sudo rm -rf vendor/easyengine/$TEST_COMMAND
2428
cp -R ../$TEST_COMMAND vendor/easyengine/
2529

2630
# Create phar and test it

composer.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "easyengine/site-wp-command",
3-
"description": "EasyEngine package for WordPress site creation.",
2+
"name": "easyengine/site-type-wp",
3+
"description": "EasyEngine site type package for WordPress site creation.",
44
"type": "ee-cli-package",
5-
"homepage": "https://github.com/easyengine/site-wp-command",
5+
"homepage": "https://github.com/easyengine/site-type-wp",
66
"license": "MIT",
77
"authors": [],
88
"minimum-stability": "dev",
@@ -11,7 +11,10 @@
1111
"psr-4": {
1212
"": "src/"
1313
},
14-
"files": [ "site-wp-command.php" ]
14+
"files": [ "site-type-wp.php" ]
15+
},
16+
"require-dev": {
17+
"wp-cli/mustangostang-spyc": "^0.6.3"
1518
},
1619
"extra": {
1720
"branch-alias": {

features/bootstrap/FeatureContext.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ public function __construct()
6565
{
6666
$this->commands = [];
6767
$this->ee_path = getcwd();
68+
$config_contents = \Mustangostang\Spyc::YAMLDump(['le-mail' => 'abc@example.com']);
69+
file_put_contents( EE_CONF_ROOT . '/config.yml', $config_contents );
6870
}
6971

7072
/**
@@ -403,7 +405,8 @@ public static function cleanup(AfterFeatureScope $scope)
403405
'www.example1.test',
404406
'example2.test',
405407
'www.example3.test',
406-
'labels.test'
408+
'labels.test',
409+
'wpcache.test',
407410
];
408411

409412
$result = EE::launch( 'sudo bin/ee site list --format=text',false, true );

features/redirect.feature

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ Feature: Site Redirection
22

33
Scenario: no_www-no_ssl redirection works properly
44
When I run 'bin/ee site create example.test --type=wp'
5-
Then Request on 'localhost' with header 'Host: www.example.test' should contain following headers:
5+
Then After delay of 5 seconds
6+
And Request on 'localhost' with header 'Host: www.example.test' should contain following headers:
67
| header |
78
| HTTP/1.1 301 Moved Permanently |
89
| Location: http://example.test/ |
910

1011
Scenario: www-no_ssl redirection works properly
1112
When I run 'bin/ee site create www.example1.test --type=wp'
12-
Then Request on 'localhost' with header 'Host: example1.test' should contain following headers:
13+
Then After delay of 5 seconds
14+
And Request on 'localhost' with header 'Host: example1.test' should contain following headers:
1315
| header |
1416
| HTTP/1.1 301 Moved Permanently |
1517
| Location: http://www.example1.test/ |

features/site.feature

+16-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ Feature: Site Command
1919

2020
Scenario: Create wp site successfully
2121
When I run 'bin/ee site create wp.test --type=wp'
22-
Then The site 'wp.test' should have webroot
22+
Then After delay of 5 seconds
23+
And The site 'wp.test' should have webroot
2324
And The site 'wp.test' should have WordPress
2425
And Request on 'wp.test' should contain following headers:
2526
| header |
@@ -28,7 +29,8 @@ Feature: Site Command
2829
Scenario: Create wpsubdir site successfully
2930
When I run 'bin/ee site create wpsubdir.test --type=wp --mu=subdir'
3031
And I create subsite '1' in 'wpsubdir.test'
31-
Then The site 'wpsubdir.test' should have webroot
32+
Then After delay of 5 seconds
33+
And The site 'wpsubdir.test' should have webroot
3234
And The site 'wpsubdir.test' should have WordPress
3335
And The site 'wpsubdir.test' should be 'subdir' multisite
3436
And Request on 'wpsubdir.test' should contain following headers:
@@ -38,20 +40,31 @@ Feature: Site Command
3840
Scenario: Create wpsubdom site successfully
3941
When I run 'bin/ee site create wpsubdom.test --type=wp --mu=subdom'
4042
And I create subsite '1' in 'wpsubdom.test'
41-
Then The site 'wpsubdom.test' should have webroot
43+
Then After delay of 5 seconds
44+
And The site 'wpsubdom.test' should have webroot
4245
And The site 'wpsubdom.test' should have WordPress
4346
And The site 'wpsubdom.test' should be 'subdomain' multisite
4447
And Request on 'wpsubdom.test' should contain following headers:
4548
| header |
4649
| HTTP/1.1 200 OK |
4750

51+
Scenario: Create wp site successfully
52+
When I run 'bin/ee site create wpcache.test --type=wp --cache'
53+
Then After delay of 5 seconds
54+
And The site 'wpcache.test' should have webroot
55+
And The site 'wpcache.test' should have WordPress
56+
And Request on 'wpcache.test' should contain following headers:
57+
| header |
58+
| HTTP/1.1 200 OK |
59+
4860
Scenario: List the sites
4961
When I run 'bin/ee site list --format=text'
5062
Then STDOUT should return exactly
5163
"""
5264
wp.test
5365
wpsubdir.test
5466
wpsubdom.test
67+
wpcache.test
5568
"""
5669

5770
Scenario: Delete the sites

site-wp-command.php renamed to site-type-wp.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
require_once $autoload;
1414
}
1515

16-
EE::add_command( 'wp', 'Site_WP_Command' );
16+
Site_Command::add_site_type( 'wp', 'EE\Site\Type\WordPress' );

0 commit comments

Comments
 (0)