Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (3 years ago)
Author:
hellofromTonya
Message:

Coding Standards: Add visibility to methods in tests/phpunit/tests/.

Adds a public visibility to test fixtures, tests, data providers, and callbacks methods.

Adds a private visibility to helper methods within test classes.

Renames callbacks and helpers that previously started with a _ prefix. Why? For consistency and to leverage using the method visibility. Further naming standardizations is beyond the scope of this commit.

Props costdev, jrf, hellofromTonya.
Fixes #54177.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/attachments.php

    r51568 r52010  
    88class Tests_Post_Attachments extends WP_UnitTestCase {
    99
    10     function tear_down() {
     10    public function tear_down() {
    1111        // Remove all uploads.
    1212        $this->remove_added_uploads();
     
    1414    }
    1515
    16     function test_insert_bogus_image() {
     16    public function test_insert_bogus_image() {
    1717        $filename = rand_str() . '.jpg';
    1818        $contents = rand_str();
     
    2222    }
    2323
    24     function test_insert_image_no_thumb() {
     24    public function test_insert_image_no_thumb() {
    2525
    2626        // This image is smaller than the thumbnail size so it won't have one.
     
    5858     * @requires function imagejpeg
    5959     */
    60     function test_insert_image_thumb_only() {
     60    public function test_insert_image_thumb_only() {
    6161        update_option( 'medium_size_w', 0 );
    6262        update_option( 'medium_size_h', 0 );
     
    109109     * @requires function imagejpeg
    110110     */
    111     function test_insert_image_medium_sizes() {
     111    public function test_insert_image_medium_sizes() {
    112112        update_option( 'medium_size_w', 400 );
    113113        update_option( 'medium_size_h', 0 );
     
    166166     * @requires function imagejpeg
    167167     */
    168     function test_insert_image_delete() {
     168    public function test_insert_image_delete() {
    169169        update_option( 'medium_size_w', 400 );
    170170        update_option( 'medium_size_h', 0 );
     
    214214     * @ticket 21963
    215215     */
    216     function test_insert_image_without_guid() {
     216    public function test_insert_image_without_guid() {
    217217        // This image is smaller than the thumbnail size so it won't have one.
    218218        $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );
     
    232232     * @ticket 21963
    233233     */
    234     function test_update_attachment_fields() {
     234    public function test_update_attachment_fields() {
    235235        $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );
    236236        $contents = file_get_contents( $filename );
     
    258258     * @ticket 29646
    259259     */
    260     function test_update_orphan_attachment_parent() {
     260    public function test_update_orphan_attachment_parent() {
    261261        $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );
    262262        $contents = file_get_contents( $filename );
Note: See TracChangeset for help on using the changeset viewer.