Code Duplication    Length = 43-43 lines in 2 locations

projects/packages/connection/tests/php/test_Secrets_unit.php 1 location

@@ 16-58 (lines=43) @@
13
/**
14
 * Connection Manager functionality testing.
15
 */
16
class SecretsTest extends TestCase {
17
18
	/**
19
	 * Temporary stack for `wp_redirect`.
20
	 *
21
	 * @var array
22
	 */
23
	protected $arguments_stack = array();
24
25
	/**
26
	 * User ID added for the test.
27
	 *
28
	 * @var int
29
	 */
30
	protected $user_id;
31
32
	const DEFAULT_TEST_CAPS = array( 'default_test_caps' );
33
34
	/**
35
	 * Initialize the object before running the test method.
36
	 *
37
	 * @before
38
	 */
39
	public function set_up() {
40
		$this->user_id = wp_insert_user(
41
			array(
42
				'user_login' => 'test_is_user_connected_with_user_id_logged_in',
43
				'user_pass'  => '123',
44
			)
45
		);
46
		wp_set_current_user( 0 );
47
	}
48
49
	/**
50
	 * Clean up the testing environment.
51
	 *
52
	 * @after
53
	 */
54
	public function tear_down() {
55
		wp_set_current_user( 0 );
56
		Constants::clear_constants();
57
	}
58
}
59

projects/packages/connection/tests/php/test_Tokens_unit.php 1 location

@@ 16-58 (lines=43) @@
13
/**
14
 * Connection Manager functionality testing.
15
 */
16
class TokensTest extends TestCase {
17
18
	/**
19
	 * Temporary stack for `wp_redirect`.
20
	 *
21
	 * @var array
22
	 */
23
	protected $arguments_stack = array();
24
25
	/**
26
	 * User ID added for the test.
27
	 *
28
	 * @var int
29
	 */
30
	protected $user_id;
31
32
	const DEFAULT_TEST_CAPS = array( 'default_test_caps' );
33
34
	/**
35
	 * Initialize the object before running the test method.
36
	 *
37
	 * @before
38
	 */
39
	public function set_up() {
40
		$this->user_id = wp_insert_user(
41
			array(
42
				'user_login' => 'test_is_user_connected_with_user_id_logged_in',
43
				'user_pass'  => '123',
44
			)
45
		);
46
		wp_set_current_user( 0 );
47
	}
48
49
	/**
50
	 * Clean up the testing environment.
51
	 *
52
	 * @after
53
	 */
54
	public function tear_down() {
55
		wp_set_current_user( 0 );
56
		Constants::clear_constants();
57
	}
58
}
59