diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8170ef..daa2c68 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/composer.json b/composer.json index 8be5cd7..6198d4c 100644 --- a/composer.json +++ b/composer.json @@ -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" @@ -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", @@ -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", @@ -84,4 +87,4 @@ "koodimonni/composer-dropin-installer": true } } -} +} \ No newline at end of file diff --git a/features/valet-new-project-bedrock.feature b/features/valet-new-project-bedrock.feature index dac57e9..6a361c1 100644 --- a/features/valet-new-project-bedrock.feature +++ b/features/valet-new-project-bedrock.feature @@ -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 | @@ -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 | @@ -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 @@ -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 diff --git a/features/valet-new.feature b/features/valet-new.feature index 86bf43d..d797cb8 100644 --- a/features/valet-new.feature +++ b/features/valet-new.feature @@ -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 @@ -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}` diff --git a/tests/Context/FeatureContext.php b/tests/Context/FeatureContext.php index 39b3f66..e6aac48 100644 --- a/tests/Context/FeatureContext.php +++ b/tests/Context/FeatureContext.php @@ -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']; $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;