Passed
Push — master ( 3befbe...811721 )
by Benjamin
03:42
created

Test_Case::test_plugin_is_loaded()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Class TestCase
4
 *
5
 * @package WPSiteMonitor
6
 * @since 1.0.0
7
 */
8
9
namespace Tests;
10
11
use WP_UnitTestCase;
12
13
/**
14
 * Base test case.
15
 */
16
class Test_Case extends WP_UnitTestCase {
17
18
	const OPTION_NAME = 'wp_site_monitor_enable';
19
	const OPTION_GROUP = 'wp_site_monitor';
20
21
	/**
22
	 * Assert that the plugin is being loaded by WordPress.
23
	 */
24
	public function test_plugin_is_loaded() {
25
		$this->assertTrue( defined( 'WP_SITE_MONITOR_VERSION' ) );
26
		$this->assertTrue( defined( 'WPINC' ) );
27
		$this->assertTrue( defined( 'WPSM_FILE' ) );
28
		$this->assertTrue( defined( 'WPSM_PATH' ) );
29
	}
30
31
	/**
32
	 * Set current WordPress user.
33
	 *
34
	 * @param string $role
35
	 */
36
	protected function log_in( $role = 'administrator' ) {
37
		wp_set_current_user( self::factory()->user->create( array( 'role' => $role ) ) );
38
	}
39
}
40