You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
If I have a pre-defined array as my first filter argument in some method, there's no easy way to write a test for how the method responds when the values this method passes to the filter change. Here's an example.
I have a static method that calls apply_filters with a large pre-defined array as its first argument:
The problem occurs in that my test needs to always have an exact clone of the $extensions_to_ignore array from my application's method. If I ever change the application's array, this test breaks even though I don't care about the input from the filter.
Describe the solution you'd like
I'd like a way to create an onFilter that takes anything and responds with what i want. Something like:
Is your feature request related to a problem? Please describe.
If I have a pre-defined array as my first filter argument in some method, there's no easy way to write a test for how the method responds when the values this method passes to the filter change. Here's an example.
I have a static method that calls
apply_filters
with a large pre-defined array as its first argument:When writing a test for the method this filter takes place in, I need to write something like so:
The problem occurs in that my test needs to always have an exact clone of the
$extensions_to_ignore
array from my application's method. If I ever change the application's array, this test breaks even though I don't care about the input from the filter.Describe the solution you'd like
I'd like a way to create an onFilter that takes anything and responds with what i want. Something like:
^ This would accept any input to the
extensions_to_ignore
filter and return['.unknown']
.Describe alternatives you've considered
Maybe something like this?
The text was updated successfully, but these errors were encountered: