Completed
Push — add/identity-crisis-package ( 055944...cfc822 )
by
unknown
88:03 queued 77:56
created

Test_Identity_Crisis::test_identity_crisis()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php //phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2
3
/**
4
 * Tests the Identity_Crisis package.
5
 *
6
 * @package automattic/jetpack-identity-crisis
7
 */
8
9
namespace Automattic\Jetpack;
10
11
use Jetpack_Options;
12
use WorDBless\BaseTestCase;
13
14
/**
15
 * Test Identity_Crisis class
16
 */
17 View Code Duplication
class Test_Identity_Crisis extends BaseTestCase {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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