Fix compatibility with PHP 5.3

Using  inside of anonymous functions is not supported in PHP 5.3
-> Injected reference to test object into anonymous function (testValidates)