Skip to content

Commit 464d91c

Browse files
committed
Merge branch 'main' into fix/child-theme-scaffolding
2 parents cfa0431 + 036c515 commit 464d91c

File tree

9 files changed

+126
-126
lines changed

9 files changed

+126
-126
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Testing
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
push:
67
branches:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ The following files are also included unless the `--skip-tests` is used:
238238
options:
239239
- circle
240240
- gitlab
241+
- bitbucket
241242
- github
242243
---
243244

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
],
1414
"require": {
15-
"wp-cli/wp-cli": "^2.5"
15+
"wp-cli/wp-cli": "^2.12"
1616
},
1717
"require-dev": {
1818
"wp-cli/extension-command": "^1.2 || ^2",
@@ -24,7 +24,8 @@
2424
"allow-plugins": {
2525
"dealerdirect/phpcodesniffer-composer-installer": true,
2626
"johnpbloch/wordpress-core-installer": true
27-
}
27+
},
28+
"lock": false
2829
},
2930
"extra": {
3031
"branch-alias": {

features/scaffold-plugin-tests.feature

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -172,42 +172,29 @@ Feature: Scaffold plugin unit tests
172172
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
173173
"""
174174
- step:
175-
image: php:5.6
176-
name: "PHP 5.6"
175+
image: php:7.4
176+
name: "PHP 7.4"
177177
script:
178178
# Install Dependencies
179-
- docker-php-ext-install mysqli
180-
- apt-get update && apt-get install -y subversion --no-install-recommends
179+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
181180
"""
182181
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
183182
"""
184183
- step:
185-
image: php:7.0
186-
name: "PHP 7.0"
184+
image: php:8.0
185+
name: "PHP 8.0"
187186
script:
188187
# Install Dependencies
189-
- docker-php-ext-install mysqli
190-
- apt-get update && apt-get install -y subversion --no-install-recommends
188+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
191189
"""
192190
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
193191
"""
194192
- step:
195-
image: php:7.1
196-
name: "PHP 7.1"
193+
image: php:8.2
194+
name: "PHP 8.2"
197195
script:
198196
# Install Dependencies
199-
- docker-php-ext-install mysqli
200-
- apt-get update && apt-get install -y subversion --no-install-recommends
201-
"""
202-
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
203-
"""
204-
- step:
205-
image: php:7.2
206-
name: "PHP 7.2"
207-
script:
208-
# Install Dependencies
209-
- docker-php-ext-install mysqli
210-
- apt-get update && apt-get install -y subversion --no-install-recommends
197+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
211198
"""
212199
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
213200
"""
@@ -309,3 +296,16 @@ Feature: Scaffold plugin unit tests
309296
"""
310297
require dirname( dirname( __FILE__ ) ) . '/bar.php';
311298
"""
299+
300+
Scenario: Accept bitbucket as valid CI in plugin scaffold
301+
Given a WP install
302+
When I run `wp plugin path`
303+
Then save STDOUT as {PLUGIN_DIR}
304+
305+
When I run `wp scaffold plugin hello-world --ci=bitbucket`
306+
Then STDOUT should not be empty
307+
And the {PLUGIN_DIR}/hello-world/.editorconfig file should exist
308+
And the {PLUGIN_DIR}/hello-world/hello-world.php file should exist
309+
And the {PLUGIN_DIR}/hello-world/readme.txt file should exist
310+
And the {PLUGIN_DIR}/hello-world/bitbucket-pipelines.yml file should exist
311+
And the {PLUGIN_DIR}/hello-world/tests directory should exist

features/scaffold-theme-tests.feature

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -168,42 +168,29 @@ Feature: Scaffold theme unit tests
168168
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
169169
"""
170170
- step:
171-
image: php:5.6
172-
name: "PHP 5.6"
171+
image: php:7.4
172+
name: "PHP 7.4"
173173
script:
174174
# Install Dependencies
175-
- docker-php-ext-install mysqli
176-
- apt-get update && apt-get install -y subversion --no-install-recommends
175+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
177176
"""
178177
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
179178
"""
180179
- step:
181-
image: php:7.0
182-
name: "PHP 7.0"
180+
image: php:8.0
181+
name: "PHP 8.0"
183182
script:
184183
# Install Dependencies
185-
- docker-php-ext-install mysqli
186-
- apt-get update && apt-get install -y subversion --no-install-recommends
184+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
187185
"""
188186
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
189187
"""
190188
- step:
191-
image: php:7.1
192-
name: "PHP 7.1"
189+
image: php:8.2
190+
name: "PHP 8.2"
193191
script:
194192
# Install Dependencies
195-
- docker-php-ext-install mysqli
196-
- apt-get update && apt-get install -y subversion --no-install-recommends
197-
"""
198-
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
199-
"""
200-
- step:
201-
image: php:7.2
202-
name: "PHP 7.2"
203-
script:
204-
# Install Dependencies
205-
- docker-php-ext-install mysqli
206-
- apt-get update && apt-get install -y subversion --no-install-recommends
193+
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
207194
"""
208195
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
209196
"""

src/Scaffold_Command.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ private function get_output_path( $assoc_args, $subdir ) {
608608
* options:
609609
* - circle
610610
* - gitlab
611+
* - bitbucket
611612
* - github
612613
* ---
613614
*

templates/install-wp-tests.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ download() {
2222
curl -s "$1" > "$2";
2323
elif [ `which wget` ]; then
2424
wget -nv -O "$2" "$1"
25+
else
26+
echo "Error: Neither curl nor wget is installed."
27+
exit 1
28+
fi
29+
}
30+
31+
# Check if svn is installed
32+
check_svn_installed() {
33+
if ! command -v svn > /dev/null; then
34+
echo "Error: svn is not installed. Please install svn and try again."
35+
exit 1
2536
fi
2637
}
2738

@@ -64,6 +75,7 @@ install_wp() {
6475
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
6576
mkdir -p $TMPDIR/wordpress-trunk
6677
rm -rf $TMPDIR/wordpress-trunk/*
78+
check_svn_installed
6779
svn export --quiet https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress
6880
mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR
6981
else
@@ -108,6 +120,7 @@ install_test_suite() {
108120
# set up testing suite
109121
mkdir -p $WP_TESTS_DIR
110122
rm -rf $WP_TESTS_DIR/{includes,data}
123+
check_svn_installed
111124
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
112125
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
113126
fi

templates/phpunit.xml.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
backupGlobals="false"
55
colors="true"
66
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
87
convertWarningsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertDeprecationsToExceptions="true"
910
>
1011
<testsuites>
1112
<testsuite name="testing">

0 commit comments

Comments
 (0)