You appear to be a bot. Output may be restricted
Description
Usage
Tests_Filters::test_filter_ref_array_result();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/filters.php
Lines:
1 to 27 of 27
public function test_filter_ref_array_result() { $obj = new stdClass(); $a = new MockAction(); $b = new MockAction(); $tag = __FUNCTION__; add_action( $tag, array( $a, 'filter_append' ), 10, 2 ); add_action( $tag, array( $b, 'filter_append' ), 10, 2 ); $result = apply_filters_ref_array( $tag, array( 'string', &$obj ) ); $this->assertSame( $result, 'string_append_append' ); $args = $a->get_args(); $this->assertSame( $args[0][1], $obj ); // Just in case we don't trust assertSame(). $obj->foo = true; $this->assertNotEmpty( $args[0][1]->foo ); $args = $b->get_args(); $this->assertSame( $args[0][1], $obj ); // Just in case we don't trust assertSame(). $obj->foo = true; $this->assertNotEmpty( $args[0][1]->foo ); }