Make component-tests compatible with PHP 5.2

Anonymous functions can only refer to $this in PHP >= 5.3