WordPress.org

Make WordPress Core

Changeset 293 in tests


Ignore:
Timestamp:
03/18/2010 09:22:25 PM (8 years ago)
Author:
westi
Message:

Add basic tests for apply_filters_ref_array() see WP#9886.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_filters.php

    r118 r293  
    190190    }
    191191
    192 
     192    function test_filter_ref_array() {
     193        $this->knownWPBug(9886);
     194        $obj = new stdClass();
     195        $a = new MockAction();
     196        $tag = rand_str();
     197
     198        add_action($tag, array(&$a, 'action'));
     199
     200        apply_filters_ref_array($tag, array(&$obj));
     201
     202        $args = $a->get_args();
     203        $this->assertSame($args[0][0], $obj);
     204        // just in case we don't trust assertSame
     205        $obj->foo = true;
     206        $this->assertFalse( empty($args[0][0]->foo) );
     207    }
    193208}
    194209
Note: See TracChangeset for help on using the changeset viewer.