phpunit.xml Env Variables Not Loaded in `testbench package:test` Command
Closed this issue · 4 comments
- Testbench Version: 8.11
- PHP Version: 8.1
Description:
when running ./vendor/bin/phpunit
directly all tests work correctly, but when testing with the command ./vendor/bin/testbench package:test
it shows No application encryption key has been specified.
This occurs when the encrypt
function is used
I tried dd($_ENV)
in testing, it seems the ./vendor/bin/testbench package:test
command doesn't load the env defined in phpunit.xml
- ./vendor/bin/phpunit
- ./vendor/bin/testbench package:test
Steps To Reproduce:
- git clone https://github.com/SupianIDz/testbench-test
- composer install
- ./vendor/bin/phpunit
- ./vendor/bin/testbench package:test
orchestral/testbench-core@5cc96a4
Unable to reproduce, our GitHub Action also being tested using package:test
and package:test --parallel
without issue.
Hi @crynobone
could you take a look reproduction of the repository? I tried in 3 different environments + github action but got the same error.
github action workflow : https://github.com/SupianIDz/testbench-test/blob/main/.github/workflows/testbench.yml
github action result : https://github.com/SupianIDz/testbench-test/actions/runs/6271550982/job/17031352888
- result from linux server
could you take a look reproduction of the repository? I tried in 3 different environments + github action but got the same error.
You can try submit a failing test to https://github.com/orchestral/testbench-core
I think this is enough: orchestral/testbench-core@b9fc730
but I am very confused about this problem, it can be seen from the reproduction of the repo, everything is very minimal but the error still occurs.
https://github.com/SupianIDz/testbench-test/blob/main/tests/FooBarTest.php#L14