Total Complexity | 5 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class APITest extends Test_Case { |
||
16 | |||
17 | /** |
||
18 | * @var WP_REST_Server; |
||
19 | */ |
||
20 | protected $server; |
||
21 | |||
22 | protected $api; |
||
23 | |||
24 | public function setUp() { |
||
25 | parent::setUp(); |
||
26 | |||
27 | $this->server = rest_get_server(); |
||
28 | $this->api = new API(); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Assert that REST API namespace for the plugin exists. |
||
33 | */ |
||
34 | public function test_rest_api_plugin_namespace_exists() { |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Assert that WordPress version endpoint exists. |
||
42 | */ |
||
43 | public function test_wp_version_endpoint_exists() { |
||
44 | $routes = $this->server->get_routes(); |
||
45 | |||
46 | $this->assertArrayHasKey( '/' . self::API_NAMESPACE . '/wp-version', $routes ); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * Assert that 'wp-version' endpoint returns the version number. |
||
51 | */ |
||
52 | public function test_wp_version_is_returned() { |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * Assert that 'wp-version' endpoint requires authentication. |
||
61 | */ |
||
62 | public function test_wp_version_requires_authentication() { |
||
66 |