Open josh-taylor opened 8 years ago
Try to define a ENVIRONMENT
constant with the value teste
(like this: https://github.com/talyssonoc/react-laravel/blob/master/phpunit.php#L7), I guess I forgot the case where a test is running but this constant does not exist.
If it solves, a PR that solves this would be welcome :smile:
I have solved it for now adding <const name="ENVIRONMENT" value="test"/>
in my phpunit.xml file. Seems a bit redundant having set APP_ENV=testing
in there also.
Would it make more sense to use a similar sort of thing as Laravel does so it doesn't need to be declared twice? If so, I could maybe start looking at a PR over the weekend for this?
I guess we could use APP_ENV
then, and read it with $_ENV
(but it's also important to remember that the user might be testing with Behat or another test tool, maybe we should check if the same env var with the same value is exported for them too).
For as Laravel does you mean using the env var or something else?
I'm getting an error that
../vendor/autoload.php
could not be found when running phpunit on a page that contains the@react_component
directive.Stack trace: