- Timestamp:
- 06/23/2023 06:27:45 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php
r55562 r55992 119 119 'is_custom' => true, 120 120 'author' => 0, 121 'modified' => mysql_to_rfc3339( self::$post->post_modified ), 121 122 ), 122 123 $this->find_and_normalize_template_by_id( $data, 'default//my_template' ) … … 163 164 'is_custom' => true, 164 165 'author' => 0, 166 'modified' => mysql_to_rfc3339( self::$post->post_modified ), 165 167 ), 166 168 $data … … 199 201 'is_custom' => true, 200 202 'author' => 0, 203 'modified' => mysql_to_rfc3339( self::$post->post_modified ), 201 204 ), 202 205 $data … … 258 261 'is_custom' => true, 259 262 'author' => self::$admin_id, 263 'modified' => mysql_to_rfc3339( $post->post_modified ), 260 264 ), 261 265 $data … … 414 418 $response = rest_get_server()->dispatch( $request ); 415 419 $data = $response->get_data(); 420 $modified = get_post( $data['wp_id'] )->post_modified; 416 421 unset( $data['_links'] ); 417 422 unset( $data['wp_id'] ); … … 437 442 'is_custom' => true, 438 443 'author' => self::$admin_id, 444 'modified' => mysql_to_rfc3339( $modified ), 439 445 ), 440 446 $data … … 460 466 $response = rest_get_server()->dispatch( $request ); 461 467 $data = $response->get_data(); 468 $modified = get_post( $data['wp_id'] )->post_modified; 462 469 unset( $data['_links'] ); 463 470 unset( $data['wp_id'] ); … … 483 490 'is_custom' => false, 484 491 'author' => self::$admin_id, 492 'modified' => mysql_to_rfc3339( $modified ), 485 493 ), 486 494 $data … … 510 518 $response = rest_get_server()->dispatch( $request ); 511 519 $data = $response->get_data(); 520 $modified = get_post( $data['wp_id'] )->post_modified; 512 521 unset( $data['_links'] ); 513 522 unset( $data['wp_id'] ); … … 533 542 'is_custom' => true, 534 543 'author' => self::$admin_id, 544 'modified' => mysql_to_rfc3339( $modified ), 535 545 ), 536 546 $data … … 691 701 $data = $response->get_data(); 692 702 $properties = $data['schema']['properties']; 693 $this->assertCount( 1 4, $properties );703 $this->assertCount( 15, $properties ); 694 704 $this->assertArrayHasKey( 'id', $properties ); 695 705 $this->assertArrayHasKey( 'description', $properties ); … … 707 717 $this->assertArrayHasKey( 'is_custom', $properties ); 708 718 $this->assertArrayHasKey( 'author', $properties ); 719 $this->assertArrayHasKey( 'modified', $properties ); 709 720 } 710 721 … … 737 748 $request = new WP_REST_Request( 'POST', '/wp/v2/templates' ); 738 749 $request->set_body_params( $body_params ); 739 $response = rest_get_server()->dispatch( $request ); 740 $data = $response->get_data(); 750 $response = rest_get_server()->dispatch( $request ); 751 $data = $response->get_data(); 752 $modified = get_post( $data['wp_id'] )->post_modified; 753 $expected['modified'] = mysql_to_rfc3339( $modified ); 741 754 unset( $data['_links'] ); 742 755 unset( $data['wp_id'] );
Note: See TracChangeset
for help on using the changeset viewer.