Make WordPress Core


Ignore:
Timestamp:
10/19/2018 01:48:42 PM (6 years ago)
Author:
danielbachhuber
Message:

REST API: Introduce Autosaves controller and endpoint.

  • Adds WP_REST_Autosaves_Controller which extends WP_REST_Revisions_Controller.
  • Autosaves endpoint is registered for all post types except attachment because even post types without revisions enabled are expected to autosave.
  • Because setting the DOING_AUTOSAVE constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.

Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue.
Fixes #43316.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/tests/phpunit/multisite.xml

    r41263 r43768  
    1010    <testsuites>
    1111        <!-- Default test suite to run all tests -->
    12         <testsuite>
     12        <testsuite name="default">
    1313            <directory suffix=".php">tests</directory>
    1414            <exclude>tests/phpunit/tests/actions/closures.php</exclude>
     
    1616            <exclude>tests/phpunit/tests/image/editorGd.php</exclude>
    1717            <exclude>tests/phpunit/tests/image/editorImagick.php</exclude>
     18            <exclude>tests/rest-api/rest-autosaves-controller.php</exclude>
    1819            <file phpVersion="5.3.0">tests/phpunit/tests/actions/closures.php</file>
    1920            <file phpVersion="5.3.0">tests/phpunit/tests/image/editor.php</file>
    2021            <file phpVersion="5.3.0">tests/phpunit/tests/image/editorGd.php</file>
    2122            <file phpVersion="5.3.0">tests/phpunit/tests/image/editorImagick.php</file>
     23        </testsuite>
     24        <!-- Sets the DOING_AUTOSAVE constant, so needs to be run last -->
     25        <testsuite name="restapi-autosave">
     26            <file>tests/rest-api/rest-autosaves-controller.php</file>
    2227        </testsuite>
    2328    </testsuites>
Note: See TracChangeset for help on using the changeset viewer.