I’m trying to add testing to an existing app we’re working on, and even though our app does not have an index-test.php file, it seems functional tests are working.
This is a bit weird since our app structure is a bit different, something like:
So the /backend folder contains only the index.php file which is the entry point which in turn loads the app from /apps/backend/
Now, functional tests work just fine for the backend app, any idea how is this possible ?
// Set debug mode on. Good to get errors when you test, right?
// But never do it in production!
defined('YII_DEBUG') or define('YII_DEBUG', true);
// This disables CAPTCHAs, CSRF token etc.
// to make testing easier. You can live w/o it but it won't be easy.
defined('YII_ENV') or define('YII_ENV', 'test');
// ...
// There you set different environment.
// You don't want to damage your real database when testing, right?
$config = require __DIR__ . '/../config/test.php';
So tests will run just fine. They could fail and consequences could be very bad but it will run.
I have no index-test.php file and yet it works, this is my question, how does the app know to use the regular index.php file when no index-test.php is present, is there a fallback on that file ?