3

I go to run an acceptance test, but it only outputs Codeception PHP Testing Framework v2.0.12 Powered by PHPUnit 4.5.1 by Sebastian Bergmann and contributors. Then it quits with out any error message. No tests run, no error message. Browser tests were working fine, and only acceptance tests were broken.

I have all ready solved the problem, but I want to create a record for next time I or any one else runs into this problem.

If you codeception is quitting without any errors or fail messages, it means that there is an error in your code somewhere. I found the error in me Acceptance Helper file, where I had a duplicate of a function. Functions can not have the same name in php, so everything fails. But codeception does not output any error messages.

In order to solve this problem, you need to look through your Helper functions to find a syntax error, or it could be in your actual tests. The reason it fails is codeception hits an error in the php code, and dies, not throwing any errors. Leaving you confused and frustrated. Now you can find this question and get back to doing what you're doing.

YAY!

user3183542
  • 186
  • 8

2 Answers2

0

There is a syntax error somewhere in your testing code, find it and get rid of it, and it will work. I'd bet the error is in the AcceptanceHelper.php or Browser or what ever suit won't run tests.

user3183542
  • 186
  • 8
0

If you're seeing this behaviour (codeception quits without any error messages) there is likely a fatal PHP error happening somewhere, but it's not necessarily in your own code or in your codeception generated files.

Depending on your PHP configuration, these errors should show up in an error log, even if they're not output to the console.

For example, if you're using MAMP on Mac, the error log is here by default: /Applications/MAMP/logs/php_error.log

Clear the PHP error log, run your (non-working) test, and check the log again. It should give more insight.

In my case, it was a matter of running codeception 4 on Laravel 5.5, and hence missing classes from the symfony/service-contracts package. Installing this package with composer moved past the "invisible" problem (though I ultimately had to downgrade to composer 3, since there doesn't seem to be a compatible set of symfony/Laravel 5.5/composer 4 packages).

Rick Gladwin
  • 4,225
  • 1
  • 17
  • 21