projects/packages/identity-crisis/tests/php/test-identity-crisis.php 1 location
|
@@ 22-38 (lines=17) @@
|
| 19 |
|
/** |
| 20 |
|
* Test that clear_all_idc_options resets Options. |
| 21 |
|
*/ |
| 22 |
|
public function test_clear_all_idc_options_clears_expected() { |
| 23 |
|
$options = array( |
| 24 |
|
'sync_error_idc', |
| 25 |
|
'safe_mode_confirmed', |
| 26 |
|
'migrate_for_idc', |
| 27 |
|
); |
| 28 |
|
|
| 29 |
|
foreach ( $options as $option ) { |
| 30 |
|
Jetpack_Options::update_option( $option, true ); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
Identity_Crisis::clear_all_idc_options(); |
| 34 |
|
|
| 35 |
|
foreach ( $options as $option ) { |
| 36 |
|
$this->assertFalse( Jetpack_Options::get_option( $option ) ); |
| 37 |
|
} |
| 38 |
|
} |
| 39 |
|
} |
| 40 |
|
|
projects/plugins/jetpack/tests/php/test_class.jetpack-idc.php 1 location
|
@@ 4-21 (lines=18) @@
|
| 1 |
|
<?php |
| 2 |
|
|
| 3 |
|
class WP_Test_Jetpack_IDC extends WP_UnitTestCase { |
| 4 |
|
function test_clear_all_idc_options_clears_expected() { |
| 5 |
|
$options = array( |
| 6 |
|
'sync_error_idc', |
| 7 |
|
'safe_mode_confirmed', |
| 8 |
|
'migrate_for_idc', |
| 9 |
|
); |
| 10 |
|
|
| 11 |
|
foreach ( $options as $option ) { |
| 12 |
|
Jetpack_Options::update_option( $option, true ); |
| 13 |
|
$this->assertTrue( Jetpack_Options::get_option( $option ) ); |
| 14 |
|
} |
| 15 |
|
|
| 16 |
|
Jetpack_IDC::clear_all_idc_options(); |
| 17 |
|
|
| 18 |
|
foreach ( $options as $option ) { |
| 19 |
|
$this->assertFalse( Jetpack_Options::get_option( $option ) ); |
| 20 |
|
} |
| 21 |
|
} |
| 22 |
|
} |
| 23 |
|
|