Completed
Push — try/refactor-secrets-and-token... ( 1bc8a1...a17499 )
by
unknown
33:04 queued 24:10
created

SecretsTest::set_up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 9
loc 9
rs 9.9666
c 0
b 0
f 0
1
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase
2
/**
3
 * Connection Manager functionality testing.
4
 *
5
 * @package automattic/jetpack-connection
6
 */
7
8
namespace Automattic\Jetpack\Connection;
9
10
use Automattic\Jetpack\Constants;
11
use PHPUnit\Framework\TestCase;
12
13
/**
14
 * Connection Manager functionality testing.
15
 */
16 View Code Duplication
class SecretsTest extends TestCase {
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...
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