You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2018. It is now read-only.
<?phpclass MainTest extends PHPUnit_Framework_TestCase
{
publicfunctiontestTestingEnvironment()
{
//constants are defined in env.php$this->assertTrue(defined(APP_ROOT));
$this->assertFileExists(VENDOR_PATH.'autoloader.php');
$this->assertTrue(class_exists('MyApp\Library\Utility'));
}
}
When I run phpunit --bootstrap bootstrap.php MainTest everything works fine. But since I have included the bootstrap file in my phpunit.xml file, I shouldn't need to do that. However, when I run phpunit MainTest it doesn't include my bootstrap file. It will throw an error that APP_ROOT has not been defined. APP_ROOT is defined in env.php, which is included in the bootstrap.php file.
I would like to be able to run my tests without having to explicitly include my bootstrap file since that functionality is built in.
Thanks in advance for the help.
The text was updated successfully, but these errors were encountered:
Simply replace 6.5 with the version number you are looking for. Simply replace en with fr, pt_br, ja, or zh_cn to access the French, Brazilian Portuguese, Japanese, or Simplified Chinese translation, respectively.
Starting with the documentation for PHPUnit 7.0, the PHPUnit documentation is hosted at https://phpunit.readthedocs.io/.
I am sorry that I have to close this issue here as GitHub does not support moving issues from one project to another. Please open a new ticket for this issue in one of the new issue trackers (see above).
My folder structure
My phpunit.xml file:
My MainTest.php file:
When I run
phpunit --bootstrap bootstrap.php MainTest
everything works fine. But since I have included the bootstrap file in my phpunit.xml file, I shouldn't need to do that. However, when I runphpunit MainTest
it doesn't include my bootstrap file. It will throw an error that APP_ROOT has not been defined. APP_ROOT is defined in env.php, which is included in the bootstrap.php file.I would like to be able to run my tests without having to explicitly include my bootstrap file since that functionality is built in.
Thanks in advance for the help.
The text was updated successfully, but these errors were encountered: