fix: #3150146 Change to Drupal root before booting in ServerCommand

Added chdir(dirname(__DIR__, 5)) to ServerCommand::execute() to change the working directory to the Drupal root before booting. This follows the same pattern already used in InstallCommand (line 76).

Also added test coverage: testServerFromNonRootDirectory() installs a site, then runs the server command from sys_get_temp_dir() and verifies it starts successfully.

Verified the fix resolves both errors:

  • "The service file core/core.services.yml is not valid" (D11/D12)
  • "SQLSTATE[HY000] [14] unable to open database file" (original report)

Merge request reports

Loading