Skip to content

Commit

Permalink
Merge branch 'main' into 140-remove-grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Jan 29, 2025
2 parents a0fd65d + 036c515 commit 6ae983a
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 126 deletions.
1 change: 1 addition & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Testing

on:
workflow_dispatch:
pull_request:
push:
branches:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ The following files are also included unless the `--skip-tests` is used:
options:
- circle
- gitlab
- bitbucket
- github
---

Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require": {
"wp-cli/wp-cli": "^2.5"
"wp-cli/wp-cli": "^2.12"
},
"require-dev": {
"wp-cli/extension-command": "^1.2 || ^2",
Expand All @@ -24,7 +24,8 @@
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"johnpbloch/wordpress-core-installer": true
}
},
"lock": false
},
"extra": {
"branch-alias": {
Expand Down
44 changes: 22 additions & 22 deletions features/scaffold-plugin-tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -172,42 +172,29 @@ Feature: Scaffold plugin unit tests
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
"""
- step:
image: php:5.6
name: "PHP 5.6"
image: php:7.4
name: "PHP 7.4"
script:
# Install Dependencies
- docker-php-ext-install mysqli
- apt-get update && apt-get install -y subversion --no-install-recommends
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
"""
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
"""
- step:
image: php:7.0
name: "PHP 7.0"
image: php:8.0
name: "PHP 8.0"
script:
# Install Dependencies
- docker-php-ext-install mysqli
- apt-get update && apt-get install -y subversion --no-install-recommends
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
"""
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
"""
- step:
image: php:7.1
name: "PHP 7.1"
image: php:8.2
name: "PHP 8.2"
script:
# Install Dependencies
- docker-php-ext-install mysqli
- apt-get update && apt-get install -y subversion --no-install-recommends
"""
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
"""
- step:
image: php:7.2
name: "PHP 7.2"
script:
# Install Dependencies
- docker-php-ext-install mysqli
- apt-get update && apt-get install -y subversion --no-install-recommends
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
"""
And the {PLUGIN_DIR}/bitbucket-pipelines.yml file should contain:
"""
Expand Down Expand Up @@ -309,3 +296,16 @@ Feature: Scaffold plugin unit tests
"""
require dirname( dirname( __FILE__ ) ) . '/bar.php';
"""

Scenario: Accept bitbucket as valid CI in plugin scaffold
Given a WP install
When I run `wp plugin path`
Then save STDOUT as {PLUGIN_DIR}

When I run `wp scaffold plugin hello-world --ci=bitbucket`
Then STDOUT should not be empty
And the {PLUGIN_DIR}/hello-world/.editorconfig file should exist
And the {PLUGIN_DIR}/hello-world/hello-world.php file should exist
And the {PLUGIN_DIR}/hello-world/readme.txt file should exist
And the {PLUGIN_DIR}/hello-world/bitbucket-pipelines.yml file should exist
And the {PLUGIN_DIR}/hello-world/tests directory should exist
31 changes: 9 additions & 22 deletions features/scaffold-theme-tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -168,42 +168,29 @@ Feature: Scaffold theme unit tests
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
"""
- step:
image: php:5.6
name: "PHP 5.6"
image: php:7.4
name: "PHP 7.4"
script:
# Install Dependencies
- docker-php-ext-install mysqli
- apt-get update && apt-get install -y subversion --no-install-recommends
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
"""
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
"""
- step:
image: php:7.0
name: "PHP 7.0"
image: php:8.0
name: "PHP 8.0"
script:
# Install Dependencies
- docker-php-ext-install mysqli
- apt-get update && apt-get install -y subversion --no-install-recommends
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
"""
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
"""
- step:
image: php:7.1
name: "PHP 7.1"
image: php:8.2
name: "PHP 8.2"
script:
# Install Dependencies
- docker-php-ext-install mysqli
- apt-get update && apt-get install -y subversion --no-install-recommends
"""
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
"""
- step:
image: php:7.2
name: "PHP 7.2"
script:
# Install Dependencies
- docker-php-ext-install mysqli
- apt-get update && apt-get install -y subversion --no-install-recommends
- apt-get update && apt-get install -y subversion git zip libzip-dev --no-install-recommends
"""
And the {THEME_DIR}/t12child/bitbucket-pipelines.yml file should contain:
"""
Expand Down
1 change: 1 addition & 0 deletions src/Scaffold_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ private function get_output_path( $assoc_args, $subdir ) {
* options:
* - circle
* - gitlab
* - bitbucket
* - github
* ---
*
Expand Down
13 changes: 13 additions & 0 deletions templates/install-wp-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ download() {
curl -s "$1" > "$2";
elif [ `which wget` ]; then
wget -nv -O "$2" "$1"
else
echo "Error: Neither curl nor wget is installed."
exit 1
fi
}

# Check if svn is installed
check_svn_installed() {
if ! command -v svn > /dev/null; then
echo "Error: svn is not installed. Please install svn and try again."
exit 1
fi
}

Expand Down Expand Up @@ -64,6 +75,7 @@ install_wp() {
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
mkdir -p $TMPDIR/wordpress-trunk
rm -rf $TMPDIR/wordpress-trunk/*
check_svn_installed
svn export --quiet https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress
mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR
else
Expand Down Expand Up @@ -108,6 +120,7 @@ install_test_suite() {
# set up testing suite
mkdir -p $WP_TESTS_DIR
rm -rf $WP_TESTS_DIR/{includes,data}
check_svn_installed
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
fi
Expand Down
3 changes: 2 additions & 1 deletion templates/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertNoticesToExceptions="true"
convertDeprecationsToExceptions="true"
>
<testsuites>
<testsuite name="testing">
Expand Down
Loading

0 comments on commit 6ae983a

Please sign in to comment.