| @@ 23-36 (lines=14) @@ | ||
| 20 | return $value; |
|
| 21 | } |
|
| 22 | ||
| 23 | function test_delete_non_compact_option_returns_true_when_successfully_deleted() { |
|
| 24 | Jetpack_Options::update_option( 'migrate_for_idc', true ); |
|
| 25 | ||
| 26 | // Make sure the option is set |
|
| 27 | $this->assertTrue( Jetpack_Options::get_option( 'migrate_for_idc' ) ); |
|
| 28 | ||
| 29 | $deleted = Jetpack_Options::delete_option( 'migrate_for_idc' ); |
|
| 30 | ||
| 31 | // Was the option successfully deleted? |
|
| 32 | $this->assertFalse( Jetpack_Options::get_option( 'migrate_for_idc' ) ); |
|
| 33 | ||
| 34 | // Did Jetpack_Options::delete_option() properly return true? |
|
| 35 | $this->assertTrue( $deleted ); |
|
| 36 | } |
|
| 37 | ||
| 38 | function test_raw_option_update_will_bypass_wp_cache_and_filters() { |
|
| 39 | $option_name = 'test_option'; |
|
| @@ 473-480 (lines=8) @@ | ||
| 470 | $this->assertFalse( Jetpack_Options::get_option( 'sync_error_idc' ) ); |
|
| 471 | } |
|
| 472 | ||
| 473 | function test_sync_error_idc_validation_cleans_up_when_part_of_validation_fails() { |
|
| 474 | $test = Jetpack::get_sync_error_idc_option(); |
|
| 475 | $test['siteurl'] = 'coolsite.com/wp/'; |
|
| 476 | Jetpack_Options::update_option( 'sync_error_idc', $test ); |
|
| 477 | ||
| 478 | $this->assertFalse( Jetpack::validate_sync_error_idc_option() ); |
|
| 479 | $this->assertFalse( Jetpack_Options::get_option( 'sync_error_idc' ) ); |
|
| 480 | } |
|
| 481 | ||
| 482 | function test_sync_error_idc_validation_returns_false_and_cleans_up_when_opted_out() { |
|
| 483 | Jetpack_Options::update_option( 'sync_error_idc', Jetpack::get_sync_error_idc_option() ); |
|