Skip to content

Commit 0314e92

Browse files
Copilotswissspidy
andcommitted
Fix test to avoid PHP parse error when simulating missing extension
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 75bcd25 commit 0314e92

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

‎features/core-install.feature‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -401,20 +401,10 @@ Feature: Install WordPress core
401401
And wp-config.php
402402
And a database
403403
404-
# Simulate a missing mysqli extension by injecting a fatal error that mimics
405-
# what happens when mysqli_connect is called but the extension is not available
406-
# This reproduces the original bug report scenario
407-
When I run `echo "<?php trigger_error('Call to undefined function mysqli_connect()', E_USER_ERROR);" > wp-includes/mysqli-check.php`
408-
Then the return code should be 0
409-
410-
# Inject this check at the beginning of upgrade.php to trigger the error during install
411-
When I run `echo "<?php require_once ABSPATH . 'wp-includes/mysqli-check.php';" > wp-admin/includes/upgrade-new.php`
412-
Then the return code should be 0
413-
414-
When I run `cat wp-admin/includes/upgrade.php >> wp-admin/includes/upgrade-new.php`
415-
Then the return code should be 0
416-
417-
When I run `mv wp-admin/includes/upgrade-new.php wp-admin/includes/upgrade.php`
404+
# Simulate a missing mysqli extension by replacing upgrade.php with code that
405+
# triggers a fatal error mimicking what happens when mysqli_connect is called
406+
# but the extension is not available. This reproduces the original bug report scenario
407+
When I run `echo "<?php trigger_error('Call to undefined function mysqli_connect()', E_USER_ERROR);" > wp-admin/includes/upgrade.php`
418408
Then the return code should be 0
419409

420410
When I try `wp core install --url=example.org --title=Test --admin_user=testadmin --admin_email=testadmin@example.com --admin_password=testpass`

0 commit comments

Comments
 (0)