I developed a set of test cases using phpunit used for testing both development site and the production site. The only difference is the domain name. How can I pass the doma
I ran into this too. One way you can do this with bash
is to export the ENV variables you want to pass in and chain the phpunit call using ;
like so:
#: HOST_NAME="my.host.com"; phpunit MyTestFile.php
That will create a HOST_NAME
environment variable and then immediately call your unit test.
Then within your test script you can access the HOST_NAME
variable using something like:
$host = getenv('HOST_NAME');