Skip to content

Commit f7506a3

Browse files
Copilotswissspidy
andcommitted
Add test scenario simulating root filesystem WP-CLI location
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 659b2c3 commit f7506a3

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

features/core-install.feature

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,39 @@ Feature: Install WordPress core
225225
http://example.com/subdir
226226
"""
227227
228+
Scenario: Install with simulated root filesystem WP-CLI executable location
229+
Given an empty directory
230+
And WP files
231+
And wp-config.php
232+
And a database
233+
And a problematic-server-vars.php file:
234+
"""
235+
<?php
236+
// Simulate WP-CLI being executed from root filesystem (e.g., /wp)
237+
// This is the problematic scenario that the fix addresses
238+
$_SERVER['PHP_SELF'] = '/wp';
239+
$_SERVER['SCRIPT_NAME'] = '/wp';
240+
$_SERVER['SCRIPT_FILENAME'] = '/wp';
241+
"""
242+
243+
When I run `wp core install --url=https://example.com --title=Test --admin_user=wpcli --admin_email=wpcli@example.org --admin_password=password --skip-email --require=problematic-server-vars.php`
244+
Then STDOUT should contain:
245+
"""
246+
Success: WordPress installed successfully.
247+
"""
248+
249+
When I run `wp option get home`
250+
Then STDOUT should be:
251+
"""
252+
https://example.com
253+
"""
254+
255+
When I run `wp option get siteurl`
256+
Then STDOUT should be:
257+
"""
258+
https://example.com
259+
"""
260+
228261
@less-than-php-7
229262
Scenario: Install WordPress with locale set to de_DE on WP < 4.0
230263
Given an empty directory

0 commit comments

Comments
 (0)