Skip to content

Instantly share code, notes, and snippets.

@rickard2
Created October 20, 2012 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rickard2/3923951 to your computer and use it in GitHub Desktop.
Save rickard2/3923951 to your computer and use it in GitHub Desktop.
Unit test for #22233
<?php
function test_multiple_calls() {
$key = rand_str();
$obj1 = new stdClass;
$obj2 = new stdClass;
$obj1->prop = false;
$obj2->prop = false;
$array = array( $obj1, $obj2 );
$this->assertTrue( add_option( $key, $array ) );
$array[0]->prop = true;
$this->assertTrue( update_option( $key, $array ) );
$array[1]->prop = true;
$this->assertTrue( update_option( $key, $array ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment