Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPunit - Errors

Tags:

php

phpunit

When an error that the PHPunit framework does not expect to occur happens, the testing stops, and PHP throws the error, but PHPunit does not record that it was an error. How do I make sure PHPunit records it as an error.

like image 777
Anthony Avatar asked Aug 25 '10 20:08

Anthony


1 Answers

Disclaimer, I'm new to PHPUnit and am trying to figure out the whole 'what happens when an error occurs' too.

From PHPUnit's docs:

When the tested code contains PHP syntax errors, the TextUI test runner might exit without printing error information. The standard test suite loader can optionally check the test suite sourcefile for PHP syntax errors, but not sourcefiles included by the test suite sourcefile.

And the option:

--syntax-check           Try to check source files for syntax errors.
like image 50
Tim Lytle Avatar answered Oct 25 '22 02:10

Tim Lytle