@@ 100-107 (lines=8) @@ | ||
97 | $builder->setNamespace( __NAMESPACE__ ) |
|
98 | ->setName( 'apply_filters' ) |
|
99 | ->setFunction( |
|
100 | function() { |
|
101 | $current_args = func_get_args(); |
|
102 | foreach ( $this->mocked_filters as $filter ) { |
|
103 | if ( array_slice( $filter, 0, -1 ) === $current_args ) { |
|
104 | return array_pop( $filter ); |
|
105 | } |
|
106 | } |
|
107 | } |
|
108 | ); |
|
109 | $this->apply_filters_mock = $builder->build(); |
|
110 | $this->apply_filters_mock->enable(); |
@@ 159-167 (lines=9) @@ | ||
156 | $builder->setNamespace( __NAMESPACE__ ) |
|
157 | ->setName( $function_name ) |
|
158 | ->setFunction( |
|
159 | function() use ( &$args ) { |
|
160 | $current_args = func_get_args(); |
|
161 | ||
162 | foreach ( $args as $arg ) { |
|
163 | if ( array_slice( $arg, 0, -1 ) === $current_args ) { |
|
164 | return array_pop( $arg ); |
|
165 | } |
|
166 | } |
|
167 | } |
|
168 | ); |
|
169 | ||
170 | $mock = $builder->build(); |