Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,29 @@ jobs:
php-version: ['7.4']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer

- name: Validate composer.json
run: composer validate --strict
run: composer validate

behat:
needs: lint
strategy:
matrix:
php-version: ['7.4', '8.2']
php-version: ['7.4', '8.2', '8.5']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer

- run: composer install

Expand Down
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"support": {
"issues": "https://github.com/aaemnnosttv/wp-cli-valet-command/issues"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"WP_CLI_Valet\\": "src"
Expand All @@ -30,8 +32,8 @@
},
"require": {
"php": ">=5.5",
"illuminate/container": ">=5.1 <5.7 || ^6.5.1 || ^7 || ^8",
"symfony/filesystem": "^2.7 || ^3 || ^4",
"illuminate/container": ">=5.1 <5.7 || >=6",
"symfony/filesystem": ">=2.7",
"wp-cli/config-command": "^1 || ^2",
"wp-cli/core-command": "^1 || ^2",
"wp-cli/db-command": "^1 || ^2",
Expand All @@ -45,7 +47,8 @@
"wp-cli/entity-command": "^1 || ^2",
"wp-cli/eval-command": "^1 || ^2",
"wp-cli/scaffold-package-command": "^2.0",
"wp-cli/wp-cli-tests": "^3.0.15"
"wp-cli/wp-cli-tests": "4.3.13",
"phpcompatibility/php-compatibility": "10.0.0-alpha2 as dev-develop"
},
"scripts": {
"behat": "behat",
Expand Down Expand Up @@ -84,4 +87,4 @@
"koodimonni/composer-dropin-installer": true
}
}
}
}
8 changes: 4 additions & 4 deletions features/valet-new-project-bedrock.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: It can create new installs for Valet-supported WordPress projects.
Success: {PROJECT} ready! https://{PROJECT}.dev
"""

When I run `cd {PROJECT} && wp user list --fields=ID,user_login,user_email`
When I try `cd {PROJECT} && wp user list --fields=ID,user_login,user_email`
Then STDOUT should be a table containing rows:
| ID | user_login | user_email |
| 1 | admin | admin@{PROJECT}.dev |
Expand All @@ -27,7 +27,7 @@ Feature: It can create new installs for Valet-supported WordPress projects.
Success: {PROJECT} ready! https://{PROJECT}.dev
"""

When I run `cd {PROJECT} && wp user list --fields=ID,user_login,user_email`
When I try `cd {PROJECT} && wp user list --fields=ID,user_login,user_email`
Then STDOUT should be a table containing rows:
| ID | user_login | user_email |
| 1 | admin | admin@{PROJECT}.dev |
Expand Down Expand Up @@ -55,7 +55,7 @@ Feature: It can create new installs for Valet-supported WordPress projects.
"""
DB_PREFIX='foo'
"""
And I run `wp eval 'echo $_SERVER["DB_PREFIX"];' --path={PATH}/{PROJECT}/web/wp/`
And I run `wp eval 'echo getenv("DB_PREFIX");' --path={PATH}/{PROJECT}/web/wp/`
Then STDOUT should be:
"""
foo
Expand All @@ -70,7 +70,7 @@ Feature: It can create new installs for Valet-supported WordPress projects.
"""
DB_HOST='127.0.0.1'
"""
And I run `wp eval 'echo $_SERVER["DB_HOST"];' --path={PROJECT}/web/wp/`
And I run `wp eval 'echo getenv("DB_HOST");' --path={PROJECT}/web/wp/`
Then STDOUT should be:
"""
127.0.0.1
Expand Down
4 changes: 2 additions & 2 deletions features/valet-new.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Feature: Create a new install.
And a random string as {ADMIN}
And a random string as {PATH}

When I run `wp valet new {PROJECT} --in={PATH} --admin_user={ADMIN} --admin_email=hello@{PROJECT}.dev --version=4.5 --dbname=wp_cli_test --dbprefix={ADMIN}_ --dbuser=wp_cli_test --dbpass=password1`
When I try `wp valet new {PROJECT} --in={PATH} --admin_user={ADMIN} --admin_email=hello@{PROJECT}.dev --version=6.0 --dbname=wp_cli_test --dbprefix={ADMIN}_ --dbuser=wp_cli_test --dbpass=password1`
Then the {PATH}/{PROJECT}/wp-config.php file should exist
Then the wp_cli_test database should exist

Expand All @@ -40,7 +40,7 @@ Feature: Create a new install.
When I run `wp core version --path={PATH}/{PROJECT}`
Then STDOUT should be:
"""
4.5
6.0
"""

When I run `wp user list --fields=ID,user_login,user_email --path={PATH}/{PROJECT}`
Expand Down
3 changes: 2 additions & 1 deletion tests/Context/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ public function aRandomProjectNameAs($name)
* @Then /^the ([^\s]+) database should( not)? exist$/
*/
public function theGivenDatabaseShouldNotExist($database_name, $should_not_exist = false) {
$mysql_binary = $this->variables['MYSQL_BINARY'];
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem related to PHP 8.5 but happy to include it 👍

$database_name = $this->replace_variables($database_name);

$process = Process::create("mysql -e 'SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = \"$database_name\";' -uroot")
$process = Process::create("$mysql_binary -e 'SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = \"$database_name\";' -uroot")
->run();

$exists = strlen(trim($process->stdout)) > 0;
Expand Down