Passed
Push — master ( 4d016b...b6e428 )
by Benjamin
02:33
created

APITest::test_rest_api_plugin_route_exists()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Class APITest
4
 *
5
 * @package WPSiteMonitor
6
 * @since 1.0.0
7
 */
8
9
use WPSiteMonitor\API;
10
11
/**
12
 * API test case.
13
 */
14
class APITest extends WP_UnitTestCase {
15
16
	protected $api;
17
	protected $server;
18
19
	public function setUp() {
20
		parent::setUp();
21
22
		$this->api = new API();
23
		$this->server = rest_get_server();
24
	}
25
26
	/**
27
	 * Assert that REST API route for the plugin exist.
28
	 */
29
	public function test_rest_api_plugin_route_exists() {
30
		$routes = $this->server->get_routes();
31
		$this->assertArrayHasKey( '/wp-site-monitor/v1', $routes );
32
	}
33
}
34