tests/test-rest-comments-controller.php 1 location
|
@@ 54-61 (lines=8) @@
|
51 |
|
parent::tearDown(); |
52 |
|
} |
53 |
|
|
54 |
|
public function test_register_routes() { |
55 |
|
$routes = $this->server->get_routes(); |
56 |
|
|
57 |
|
$this->assertArrayHasKey( '/wp/v2/comments', $routes ); |
58 |
|
$this->assertCount( 2, $routes['/wp/v2/comments'] ); |
59 |
|
$this->assertArrayHasKey( '/wp/v2/comments/(?P<id>[\d]+)', $routes ); |
60 |
|
$this->assertCount( 3, $routes['/wp/v2/comments/(?P<id>[\d]+)'] ); |
61 |
|
} |
62 |
|
|
63 |
|
public function test_context_param() { |
64 |
|
// Collection |
tests/test-rest-posts-controller.php 1 location
|
@@ 29-36 (lines=8) @@
|
26 |
|
register_post_type( 'youseeme', array( 'supports' => array(), 'show_in_rest' => true ) ); |
27 |
|
} |
28 |
|
|
29 |
|
public function test_register_routes() { |
30 |
|
$routes = $this->server->get_routes(); |
31 |
|
|
32 |
|
$this->assertArrayHasKey( '/wp/v2/posts', $routes ); |
33 |
|
$this->assertCount( 2, $routes['/wp/v2/posts'] ); |
34 |
|
$this->assertArrayHasKey( '/wp/v2/posts/(?P<id>[\d]+)', $routes ); |
35 |
|
$this->assertCount( 3, $routes['/wp/v2/posts/(?P<id>[\d]+)'] ); |
36 |
|
} |
37 |
|
|
38 |
|
public function test_context_param() { |
39 |
|
// Collection |
tests/test-rest-revisions-controller.php 1 location
|
@@ 32-38 (lines=7) @@
|
29 |
|
$this->revision_id2 = $this->revision_2->ID; |
30 |
|
} |
31 |
|
|
32 |
|
public function test_register_routes() { |
33 |
|
$routes = $this->server->get_routes(); |
34 |
|
$this->assertArrayHasKey( '/wp/v2/posts/(?P<parent>[\d]+)/revisions', $routes ); |
35 |
|
$this->assertArrayHasKey( '/wp/v2/posts/(?P<parent>[\d]+)/revisions/(?P<id>[\d]+)', $routes ); |
36 |
|
$this->assertArrayHasKey( '/wp/v2/pages/(?P<parent>[\d]+)/revisions', $routes ); |
37 |
|
$this->assertArrayHasKey( '/wp/v2/pages/(?P<parent>[\d]+)/revisions/(?P<id>[\d]+)', $routes ); |
38 |
|
} |
39 |
|
|
40 |
|
public function test_context_param() { |
41 |
|
// Collection |
tests/test-rest-users-controller.php 1 location
|
@@ 28-36 (lines=9) @@
|
25 |
|
$this->endpoint = new WP_REST_Users_Controller(); |
26 |
|
} |
27 |
|
|
28 |
|
public function test_register_routes() { |
29 |
|
$routes = $this->server->get_routes(); |
30 |
|
|
31 |
|
$this->assertArrayHasKey( '/wp/v2/users', $routes ); |
32 |
|
$this->assertCount( 2, $routes['/wp/v2/users'] ); |
33 |
|
$this->assertArrayHasKey( '/wp/v2/users/(?P<id>[\d]+)', $routes ); |
34 |
|
$this->assertCount( 3, $routes['/wp/v2/users/(?P<id>[\d]+)'] ); |
35 |
|
$this->assertArrayHasKey( '/wp/v2/users/me', $routes ); |
36 |
|
} |
37 |
|
|
38 |
|
public function test_context_param() { |
39 |
|
// Collection |
tests/test-rest-attachments-controller.php 1 location
|
@@ 33-39 (lines=7) @@
|
30 |
|
|
31 |
|
} |
32 |
|
|
33 |
|
public function test_register_routes() { |
34 |
|
$routes = $this->server->get_routes(); |
35 |
|
$this->assertArrayHasKey( '/wp/v2/media', $routes ); |
36 |
|
$this->assertCount( 2, $routes['/wp/v2/media'] ); |
37 |
|
$this->assertArrayHasKey( '/wp/v2/media/(?P<id>[\d]+)', $routes ); |
38 |
|
$this->assertCount( 3, $routes['/wp/v2/media/(?P<id>[\d]+)'] ); |
39 |
|
} |
40 |
|
|
41 |
|
public static function disposition_provider() { |
42 |
|
return array( |