Make WordPress Core


Ignore:
Timestamp:
07/13/2021 10:43:42 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Clean up skipping conditions and requirements for various tests.

This improves the consistency of test skipping and ensures that:

  • The @requires annotations use the right condition and format, and are on the right level (class vs. function).
  • Inline conditions with a markTestSkipped() call are only used when annotations cannot be used.
  • All markTestSkipped() calls contain a verbose explanation of why the test is being skipped.

Props jrf, hellofromTonya.
Fixes #53009.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php

    r51404 r51415  
    744744    }
    745745
     746    /**
     747     * @requires function imagejpeg
     748     */
    746749    public function test_create_item() {
    747750        wp_set_current_user( self::$author_id );
     
    793796    }
    794797
     798    /**
     799     * @requires function imagejpeg
     800     */
    795801    public function test_create_item_with_files() {
    796802        wp_set_current_user( self::$author_id );
     
    811817    }
    812818
     819    /**
     820     * @requires function imagejpeg
     821     */
    813822    public function test_create_item_with_upload_files_role() {
    814823        wp_set_current_user( self::$uploader_id );
     
    925934    }
    926935
     936    /**
     937     * @requires function imagejpeg
     938     */
    927939    public function test_create_item_alt_text() {
    928940        wp_set_current_user( self::$author_id );
     
    938950    }
    939951
     952    /**
     953     * @requires function imagejpeg
     954     */
    940955    public function test_create_item_unsafe_alt_text() {
    941956        wp_set_current_user( self::$author_id );
     
    952967    /**
    953968     * @ticket 40861
     969     * @requires function imagejpeg
    954970     */
    955971    public function test_create_item_ensure_relative_path() {
     
    12751291    /**
    12761292     * @dataProvider attachment_roundtrip_provider
     1293     * @requires function imagejpeg
    12771294     */
    12781295    public function test_post_roundtrip_as_author( $raw, $expected ) {
     
    12821299    }
    12831300
     1301    /**
     1302     * @requires function imagejpeg
     1303     */
    12841304    public function test_attachment_roundtrip_as_editor_unfiltered_html() {
    12851305        wp_set_current_user( self::$editor_id );
     
    13331353    }
    13341354
     1355    /**
     1356     * @requires function imagejpeg
     1357     */
    13351358    public function test_attachment_roundtrip_as_superadmin_unfiltered_html() {
    13361359        wp_set_current_user( self::$superadmin_id );
     
    18091832     *
    18101833     * @ticket 45269
     1834     * @requires function imagejpeg
    18111835     */
    18121836    public function test_rest_insert_attachment_hooks_fire_once_on_create() {
     
    18661890    /**
    18671891     * @ticket 44567
     1892     * @requires function imagejpeg
    18681893     */
    18691894    public function test_create_item_with_meta_values() {
     
    19031928    /**
    19041929     * @ticket 44405
     1930     * @requires function imagejpeg
    19051931     */
    19061932    public function test_edit_image_returns_error_if_logged_out() {
     
    19151941    /**
    19161942     * @ticket 44405
     1943     * @requires function imagejpeg
    19171944     */
    19181945    public function test_edit_image_returns_error_if_cannot_upload() {
     
    19311958    /**
    19321959     * @ticket 44405
     1960     * @requires function imagejpeg
    19331961     */
    19341962    public function test_edit_image_returns_error_if_cannot_edit() {
     
    19571985    /**
    19581986     * @ticket 44405
     1987     * @requires function imagejpeg
    19591988     */
    19601989    public function test_edit_image_returns_error_if_unsupported_mime_type() {
     
    19762005    /**
    19772006     * @ticket 44405
     2007     * @requires function imagejpeg
    19782008     */
    19792009    public function test_edit_image_returns_error_if_no_edits() {
     
    19892019    /**
    19902020     * @ticket 44405
     2021     * @requires function imagejpeg
    19912022     */
    19922023    public function test_edit_image_rotate() {
     
    20132044    /**
    20142045     * @ticket 44405
     2046     * @requires function imagejpeg
    20152047     */
    20162048    public function test_edit_image_crop() {
     
    21192151    /**
    21202152     * @ticket 50565
     2153     * @requires function imagejpeg
    21212154     */
    21222155    public function test_edit_image_returns_error_if_mismatched_src() {
Note: See TracChangeset for help on using the changeset viewer.