Passed
Push — master ( 811721...96a06a )
by Benjamin
02:26
created

APITest::test_wp_version_endpoint_exists()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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