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
At the moment, the expectFilter expects a precise value to be passed as part of its argument. Can we also provide support for the use of types within our params like so:
I would like to see a situation where we are able to pass in types. This could cater for scenarios where we DO NOT have precise values, but we expect the instance of a Class to be passed in like so:
public function get_provider(): Provider {
$tag_provider = get_option( 'tag_provider', [] )['name'] ?? '';
switch ( $tag_provider ) {
case 'WP_Tags':
$tag_provider = new TagProvider();
break;
}
/**
* Filter Tag Provider.
*
* @param Provider $tag_provider Tag Provider.
* @return Provider
*/
return apply_filters( 'tag_provider', $tag_provider );
}
We should be able to do this within our test cases:
Feature request
At the moment, the
expectFilter
expects a precise value to be passed as part of its argument. Can we also provide support for the use of types within our params like so:OR
Proposed solution
I would like to see a situation where we are able to pass in types. This could cater for scenarios where we DO NOT have precise values, but we expect the instance of a Class to be passed in like so:
We should be able to do this within our test cases:
The text was updated successfully, but these errors were encountered: