Make WordPress Core

Ticket #39466: 39466.3.diff

File 39466.3.diff, 3.3 KB (added by rachelbaker, 8 years ago)

Includes an updated tests/qunit/fixtures/wp-api-generated.js file

  • src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

     
    17671767                                        'description' => __( 'A named status for the object.' ),
    17681768                                        'type'        => 'string',
    17691769                                        'enum'        => array_keys( get_post_stati( array( 'internal' => false ) ) ),
    1770                                         'context'     => array( 'edit' ),
     1770                                        'context'     => array( 'view', 'edit' ),
    17711771                                ),
    17721772                                'type'            => array(
    17731773                                        'description' => __( 'Type of Post for the object.' ),
  • tests/phpunit/includes/testcase-rest-post-type-controller.php

     
    134134                        $this->assertFalse( isset( $data['excerpt'] ) );
    135135                }
    136136
     137                $this->assertEquals( $post->post_status, $data['status'] );
    137138                $this->assertEquals( $post->guid, $data['guid']['rendered'] );
    138139
    139140                if ( 'edit' === $context ) {
    140141                        $this->assertEquals( $post->guid, $data['guid']['raw'] );
    141                         $this->assertEquals( $post->post_status, $data['status'] );
    142142
    143143                        if ( '0000-00-00 00:00:00' === $post->post_date_gmt ) {
    144144                                $this->assertNull( $data['date_gmt'] );
  • tests/qunit/fixtures/wp-api-generated.js

     
    33843384        "modified": "2017-02-14T00:00:00",
    33853385        "modified_gmt": "2017-02-14T00:00:00",
    33863386        "slug": "restapi-client-fixture-post",
     3387        "status": "publish",
    33873388        "type": "post",
    33883389        "link": "http://example.org/?p=3",
    33893390        "title": {
     
    34743475    "modified": "2017-02-14T00:00:00",
    34753476    "modified_gmt": "2017-02-14T00:00:00",
    34763477    "slug": "restapi-client-fixture-post",
     3478    "status": "publish",
    34773479    "type": "post",
    34783480    "link": "http://example.org/?p=3",
    34793481    "title": {
     
    35523554        "modified": "2017-02-14T00:00:00",
    35533555        "modified_gmt": "2017-02-14T00:00:00",
    35543556        "slug": "restapi-client-fixture-page",
     3557        "status": "publish",
    35553558        "type": "page",
    35563559        "link": "http://example.org/?page_id=5",
    35573560        "title": {
     
    36263629    "modified": "2017-02-14T00:00:00",
    36273630    "modified_gmt": "2017-02-14T00:00:00",
    36283631    "slug": "restapi-client-fixture-page",
     3632    "status": "publish",
    36293633    "type": "page",
    36303634    "link": "http://example.org/?page_id=5",
    36313635    "title": {
     
    37003704        "modified": "2017-02-14T00:00:00",
    37013705        "modified_gmt": "2017-02-14T00:00:00",
    37023706        "slug": "restapi-client-fixture-attachment",
     3707        "status": "inherit",
    37033708        "type": "attachment",
    37043709        "link": "http://example.org/?attachment_id=7",
    37053710        "title": {
     
    37583763    "modified": "2017-02-14T00:00:00",
    37593764    "modified_gmt": "2017-02-14T00:00:00",
    37603765    "slug": "restapi-client-fixture-attachment",
     3766    "status": "inherit",
    37613767    "type": "attachment",
    37623768    "link": "http://example.org/?attachment_id=7",
    37633769    "title": {