Code Duplication    Length = 20-23 lines in 2 locations

projects/packages/identity-crisis/tests/php/test-identity-crisis.php 1 location

@@ 17-39 (lines=23) @@
14
/**
15
 * Test Identity_Crisis class
16
 */
17
class Test_Identity_Crisis extends BaseTestCase {
18
	/**
19
	 * Test Identity_Crisis.
20
	 */
21
	public function test_clear_all_idc_options_clears_expected() {
22
		$options = array(
23
			'sync_error_idc',
24
			'safe_mode_confirmed',
25
			'migrate_for_idc',
26
		);
27
28
		foreach ( $options as $option ) {
29
			Jetpack_Options::update_option( $option, true );
30
			$this->assertTrue( Jetpack_Options::get_option( $option ) );
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

@@ 3-22 (lines=20) @@
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