Change tests to no longer rely on array_filter() declaration
Instead, use locally declared function where the result is clear