@@ -168,6 +168,7 @@ public function test_get_items() {
168168 'is_custom ' => true ,
169169 'author ' => 0 ,
170170 'modified ' => mysql_to_rfc3339 ( self ::$ template_post ->post_modified ),
171+ 'date ' => mysql_to_rfc3339 ( self ::$ template_post ->post_date ),
171172 'author_text ' => 'Test Blog ' ,
172173 'original_source ' => 'site ' ,
173174 ),
@@ -247,6 +248,7 @@ public function test_get_items_editor() {
247248 'is_custom ' => true ,
248249 'author ' => 0 ,
249250 'modified ' => mysql_to_rfc3339 ( self ::$ template_post ->post_modified ),
251+ 'date ' => mysql_to_rfc3339 ( self ::$ template_post ->post_date ),
250252 'author_text ' => 'Test Blog ' ,
251253 'original_source ' => 'site ' ,
252254 ),
@@ -304,6 +306,7 @@ public function test_get_item() {
304306 'is_custom ' => true ,
305307 'author ' => 0 ,
306308 'modified ' => mysql_to_rfc3339 ( self ::$ template_post ->post_modified ),
309+ 'date ' => mysql_to_rfc3339 ( self ::$ template_post ->post_date ),
307310 'author_text ' => 'Test Blog ' ,
308311 'original_source ' => 'site ' ,
309312 ),
@@ -355,6 +358,7 @@ public function test_get_item_editor() {
355358 'is_custom ' => true ,
356359 'author ' => 0 ,
357360 'modified ' => mysql_to_rfc3339 ( self ::$ template_post ->post_modified ),
361+ 'date ' => mysql_to_rfc3339 ( self ::$ template_post ->post_date ),
358362 'author_text ' => 'Test Blog ' ,
359363 'original_source ' => 'site ' ,
360364 ),
@@ -404,6 +408,7 @@ public function test_get_item_works_with_a_single_slash( $endpoint_url ) {
404408 'is_custom ' => true ,
405409 'author ' => 0 ,
406410 'modified ' => mysql_to_rfc3339 ( self ::$ template_post ->post_modified ),
411+ 'date ' => mysql_to_rfc3339 ( self ::$ template_post ->post_date ),
407412 'author_text ' => 'Test Blog ' ,
408413 'original_source ' => 'site ' ,
409414 ),
@@ -469,6 +474,7 @@ public function test_get_item_with_valid_theme_dirname( $theme_dir, $template, a
469474 'modified ' => mysql_to_rfc3339 ( $ post ->post_modified ),
470475 'author_text ' => $ author_name ,
471476 'original_source ' => 'user ' ,
477+ 'date ' => mysql_to_rfc3339 ( $ post ->post_date ),
472478 ),
473479 $ data
474480 );
@@ -673,6 +679,7 @@ public function test_create_item() {
673679 $ response = rest_get_server ()->dispatch ( $ request );
674680 $ data = $ response ->get_data ();
675681 $ modified = get_post ( $ data ['wp_id ' ] )->post_modified ;
682+ $ date = get_post ( $ data ['wp_id ' ] )->post_date ;
676683 unset( $ data ['_links ' ] );
677684 unset( $ data ['wp_id ' ] );
678685
@@ -699,6 +706,7 @@ public function test_create_item() {
699706 'is_custom ' => true ,
700707 'author ' => self ::$ admin_id ,
701708 'modified ' => mysql_to_rfc3339 ( $ modified ),
709+ 'date ' => mysql_to_rfc3339 ( $ date ),
702710 'author_text ' => $ author_name ,
703711 'original_source ' => 'user ' ,
704712 ),
@@ -725,6 +733,7 @@ public function test_create_item_with_numeric_slug() {
725733 $ response = rest_get_server ()->dispatch ( $ request );
726734 $ data = $ response ->get_data ();
727735 $ modified = get_post ( $ data ['wp_id ' ] )->post_modified ;
736+ $ date = get_post ( $ data ['wp_id ' ] )->post_date ;
728737 unset( $ data ['_links ' ] );
729738 unset( $ data ['wp_id ' ] );
730739
@@ -751,6 +760,7 @@ public function test_create_item_with_numeric_slug() {
751760 'is_custom ' => false ,
752761 'author ' => self ::$ admin_id ,
753762 'modified ' => mysql_to_rfc3339 ( $ modified ),
763+ 'date ' => mysql_to_rfc3339 ( $ date ),
754764 'author_text ' => $ author_name ,
755765 'original_source ' => 'user ' ,
756766 ),
@@ -781,6 +791,7 @@ public function test_create_item_raw() {
781791 $ response = rest_get_server ()->dispatch ( $ request );
782792 $ data = $ response ->get_data ();
783793 $ modified = get_post ( $ data ['wp_id ' ] )->post_modified ;
794+ $ date = get_post ( $ data ['wp_id ' ] )->post_date ;
784795 unset( $ data ['_links ' ] );
785796 unset( $ data ['wp_id ' ] );
786797
@@ -807,6 +818,7 @@ public function test_create_item_raw() {
807818 'is_custom ' => true ,
808819 'author ' => self ::$ admin_id ,
809820 'modified ' => mysql_to_rfc3339 ( $ modified ),
821+ 'date ' => mysql_to_rfc3339 ( $ date ),
810822 'author_text ' => $ author_name ,
811823 'original_source ' => 'user ' ,
812824 ),
@@ -967,7 +979,7 @@ public function test_get_item_schema() {
967979 $ response = rest_get_server ()->dispatch ( $ request );
968980 $ data = $ response ->get_data ();
969981 $ properties = $ data ['schema ' ]['properties ' ];
970- $ this ->assertCount ( 18 , $ properties );
982+ $ this ->assertCount ( 19 , $ properties );
971983 $ this ->assertArrayHasKey ( 'id ' , $ properties );
972984 $ this ->assertArrayHasKey ( 'description ' , $ properties );
973985 $ this ->assertArrayHasKey ( 'slug ' , $ properties );
@@ -984,6 +996,7 @@ public function test_get_item_schema() {
984996 $ this ->assertArrayHasKey ( 'is_custom ' , $ properties );
985997 $ this ->assertArrayHasKey ( 'author ' , $ properties );
986998 $ this ->assertArrayHasKey ( 'modified ' , $ properties );
999+ $ this ->assertArrayHasKey ( 'date ' , $ properties );
9871000 $ this ->assertArrayHasKey ( 'author_text ' , $ properties );
9881001 $ this ->assertArrayHasKey ( 'original_source ' , $ properties );
9891002 $ this ->assertArrayHasKey ( 'plugin ' , $ properties );
@@ -1020,7 +1033,9 @@ public function test_create_item_with_is_wp_suggestion( array $body_params, arra
10201033 $ response = rest_get_server ()->dispatch ( $ request );
10211034 $ data = $ response ->get_data ();
10221035 $ modified = get_post ( $ data ['wp_id ' ] )->post_modified ;
1036+ $ date = get_post ( $ data ['wp_id ' ] )->post_date ;
10231037 $ expected ['modified ' ] = mysql_to_rfc3339 ( $ modified );
1038+ $ expected ['date ' ] = mysql_to_rfc3339 ( $ date );
10241039 $ expected ['author_text ' ] = get_user_by ( 'id ' , self ::$ admin_id )->get ( 'display_name ' );
10251040 $ expected ['original_source ' ] = 'user ' ;
10261041
0 commit comments