FUnit icon indicating copy to clipboard operation
FUnit copied to clipboard

php 5.3 compatibility

Open kanellov opened this issue 10 years ago • 0 comments

Hello,

in your README.md file you mention that "FUnit is a testing microframework for PHP 5.3+...". After using it to test my projects, i noticed that the methods throws and all_ok fail when using php 5.3 throwing the following error:

CATCHABLE FATAL ERROR: Argument 2 passed to FUnit::assert_all_ok() must be an instance of callable, instance of Closure given, called in <<test file>> on line 58 and defined in ...

These two methods use the php type hint callable, which is available in php >= 5.4 (Callbacks / Callables).

Also, the unit tests do not work in php 5.3 because of the array dereference, also supported by php >= 5.4.

I' ve enabled the FUnit's methods throws and all_ok to accept any callables and also updated the unit tests in order to work with php 5.3.

Tell me what you think about it !

kanellov avatar Mar 10 '15 15:03 kanellov