WordPress / phpunit-test-runner

GNU General Public License v2.0
68 stars 64 forks source link

Undefined constant "DB_HOST" Latest Pull #208

Open forgetwp opened 10 months ago

forgetwp commented 10 months ago

Just pulled latest version to test issue #154 however, now I am facing with this when testing immediately after doing php test.php following error shows up: (The .env file is set correctly)

Node v21.6.1 (npm v10.2.4) Success: Prepared environment. Environment PHP Version: 8.3.2 Environment variables pass checks. PHPUnit 9.6.16 by Sebastian Bergmann and contributors.

Error in bootstrap script: Error: Undefined constant "DB_HOST"

0 /phpunit-test-runner/wptest/tests/phpunit/includes/bootstrap.php(30): require_once() 1 /phpunit-test-runner/wptest/vendor/phpunit/phpunit/src/Util/FileLoader.php(66): include_once('...') 2 /phpunit-test-runner/wptest/vendor/phpunit/phpunit/src/Util/FileLoader.php(49): PHPUnit\Util\FileLoader::load() 3 /phpunit-test-runner/wptest/vendor/phpunit/phpunit/src/TextUI/Command.php(565): PHPUnit\Util\FileLoader::checkAndLoad() 4 /phpunit-test-runner/wptest/vendor/phpunit/phpunit/src/TextUI/Command.php(345): PHPUnit\TextUI\Command->handleBootstrap() 5 /phpunit-test-runner/wptest/vendor/phpunit/phpunit/src/TextUI/Command.php(112): PHPUnit\TextUI\Command->handleArguments() 6 /phpunit-test-runner/wptest/vendor/phpunit/phpunit/src/TextUI/Command.php(97): PHPUnit\TextUI\Command->run() 7 /phpunit-test-runner/wptest/vendor/phpunit/phpunit/phpunit(107): PHPUnit\TextUI\Command::main() 8 {main} Error: Failed to perform operation.

javiercasares commented 10 months ago

We fixed it with the latest commit.

grooverdan commented 10 months ago

Ack. Appoligies for the commit that broke it. Thanks @javiercasares for fixing . I've still no idea how phpunit-test-runner wrote 'DB_HOST' into a test config file.

javiercasares commented 10 months ago

Don't worry. I left the code because I think we can check what is happening and fix it. We'll do more testing until find a way to get the version ;)