| | 239 | |
| | 240 | function _add_at_nine($tag) { |
| | 241 | $a = new MockAction(); |
| | 242 | add_action( $tag, array(&$a, 'filter_append'), 9, 1 ); |
| | 243 | return $tag; |
| | 244 | } |
| | 245 | |
| | 246 | function test_filter_addition_during_filter() { |
| | 247 | $tag = rand_str(); |
| | 248 | $a = new MockAction(); |
| | 249 | |
| | 250 | add_action( $tag, array(&$this, '_add_at_nine'), 10, 1 ); |
| | 251 | add_action( $tag, array(&$a, 'filter_append'), 11, 1 ); |
| | 252 | |
| | 253 | $result = apply_filters($tag, $tag); |
| | 254 | $this->assertEquals( $result, $tag . '_append', 'priority 9 action should not run after priority 10 action adds it' ); |
| | 255 | |
| | 256 | } |