Acceptance Testing - "Unable to determine the entry script file path."

I have spent all day trying to work out what this error is and not found anything. Every time i try to run an acceptance test it fails on the amOnPage function throwing the following error. If i remove the Yii2 Module in codeception yml the test work fine.

Failed to login in [\codeception\backend\acceptance\customerWizardCest::testCreateJob[(C:\xampp\htdocs\osca\tests\codeception\backend\.\acceptance\customerWizardCest.php)

Can’t be on page “/index-test.php/user/login”:

yii\base\InvalidConfigException: Unable to determine the entry script file path.

If anyone could help it would be grateful.

Adding

$_SERVER[‘SCRIPT_FILENAME’] = YII_TEST_BACKEND_ENTRY_FILE;

$_SERVER[‘SCRIPT_NAME’] = YII_BACKEND_TEST_ENTRY_URL;

to the config file removes the error but i just get white pages on browser.