Skip to content

Commit 6927209

Browse files
Remove problematic test for now
1 parent cc15512 commit 6927209

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

tests/phpunit/tests/rest-api/rest-post-meta-fields.php

-50
Original file line numberDiff line numberDiff line change
@@ -3470,54 +3470,4 @@ public function data_revisioned_single_post_meta_with_posts_endpoint_page_and_cp
34703470
),
34713471
);
34723472
}
3473-
3474-
/**
3475-
* Test autosaves controller works with meta, including slashed data
3476-
*/
3477-
public function test_autosaves_controller_works_with_meta() {
3478-
$meta = '[{\"content\":\"foot 1\",\"id\":\"fa97a10d-7401-42b9-ac54-df8f4510749a\"},{\"content\":\"fdddddoot 2\\\"\",\"id\":\"2216d0aa-34b8-42b4-b441-84dedc0406e0\"}]';
3479-
$this->grant_write_permission();
3480-
3481-
// Create the custom meta.
3482-
register_post_meta(
3483-
'post',
3484-
'foo',
3485-
array(
3486-
'show_in_rest' => true,
3487-
'revisions_enabled' => true,
3488-
'single' => true,
3489-
'type' => 'string',
3490-
)
3491-
);
3492-
3493-
// Set up a new post.
3494-
$post_id = $this->factory->post->create(
3495-
array(
3496-
'post_content' => 'initial content',
3497-
'post_type' => 'post',
3498-
'meta_input' => array(
3499-
'foo' => 'foo',
3500-
),
3501-
)
3502-
);
3503-
3504-
// Create an autosave with the test meta.
3505-
$request = new WP_REST_Request( 'POST', sprintf( '/wp/v2/posts/%d/autosaves', $post_id ) );
3506-
$request->set_body_params(
3507-
array(
3508-
'title' => 'Revision 1',
3509-
'meta' => array( 'foo' => $meta ),
3510-
)
3511-
);
3512-
$response = rest_get_server()->dispatch( $request );
3513-
$this->assertSame( 200, $response->get_status() );
3514-
$data = $response->get_data();
3515-
// Can json decode values.
3516-
$values = json_decode( wp_unslash( $data['meta']['foo'] ), true );
3517-
$this->assertNotNull( $values );
3518-
3519-
// Clean up the post.
3520-
delete_post_meta( $post_id, 'foo' );
3521-
unregister_post_meta( 'post', 'foo' );
3522-
}
35233473
}

0 commit comments

Comments
 (0)