public function test_get_namespaces() { $server = new WP_REST_Server(); $server->register_route('test/example', '/test/example/some-route', array(array('methods' => WP_REST_Server::READABLE, 'callback' => '__return_true'))); $server->register_route('test/another', '/test/another/route', array(array('methods' => WP_REST_Server::READABLE, 'callback' => '__return_false'))); $namespaces = $server->get_namespaces(); $this->assertContains('test/example', $namespaces); $this->assertContains('test/another', $namespaces); }