more of an FYI than a helpful comment but you can put alternative env variables in the phpunit.xml eg

  1. <php>
  2. <const name="MYVAR" type="bool" value="true"/>
  3. </php>
  1. <phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true">
  2. <php>
  3. <const name="SS_DATABASE_CLASS" type="bool" value="null"/>
  4. <const name="SS_DATABASE_USERNAME" type="bool" value="null"/>
  5. </php>

yeap - sorry just posted the php bit - the 'type' is probably 'string'. I guess the idea being that you could set the SQLite values here and they'd apply during a test run

Hmm, trying to clear the existing constants doesn't seem to work (both null and "" at least)

I guess like you said, I could just set the SQLite settings instead


Constants are not the same as env vars though - SS3 used constants, SS4 uses env vars.

like this then ? <env name="KERNEL_CLASS" value="App\Kernel" />

although now I get Exception: SapphireTest failed to bootstrap! in /project/vendor/silverstripe/framework/src/Dev/SapphireTest.php:363

OK, commented out SS_DATABASE_CLASS and SS_DATABASE_USERNAME from my project's .env and not I am hitting the correct switch case

Ahh, it is because I have satabase class and username defined

so now it's a question about why it's ignoring your env var. Test get_env or whatever it is.