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/term/getTerms.php

    r51568 r52010  
    55 */
    66class Tests_Term_getTerms extends WP_UnitTestCase {
    7     function set_up() {
     7    public function set_up() {
    88        parent::set_up();
    99
     
    198198     * @ticket 23506
    199199     */
    200     function test_get_terms_should_allow_arbitrary_indexed_taxonomies_array() {
     200    public function test_get_terms_should_allow_arbitrary_indexed_taxonomies_array() {
    201201        $term_id = self::factory()->tag->create();
    202202        $terms   = get_terms( array( '111' => 'post_tag' ), array( 'hide_empty' => false ) );
     
    207207     * @ticket 13661
    208208     */
    209     function test_get_terms_fields() {
     209    public function test_get_terms_fields() {
    210210        $term_id1 = self::factory()->tag->create(
    211211            array(
     
    289289     * @ticket 11823
    290290     */
    291     function test_get_terms_include_exclude() {
     291    public function test_get_terms_include_exclude() {
    292292        global $wpdb;
    293293
     
    372372     * @ticket 25710
    373373     */
    374     function test_get_terms_exclude_tree() {
     374    public function test_get_terms_exclude_tree() {
    375375
    376376        $term_id_uncategorized = get_option( 'default_category' );
     
    407407     * @ticket 13992
    408408     */
    409     function test_get_terms_search() {
     409    public function test_get_terms_search() {
    410410        $term_id1 = self::factory()->tag->create( array( 'slug' => 'burrito' ) );
    411411        $term_id2 = self::factory()->tag->create( array( 'name' => 'Wilbur' ) );
     
    426426     * @ticket 8214
    427427     */
    428     function test_get_terms_like() {
     428    public function test_get_terms_like() {
    429429        $term_id1 = self::factory()->tag->create(
    430430            array(
     
    524524     * @ticket 26903
    525525     */
    526     function test_get_terms_parent_zero() {
     526    public function test_get_terms_parent_zero() {
    527527        $tax = 'food';
    528528        register_taxonomy( $tax, 'post', array( 'hierarchical' => true ) );
     
    625625     * @ticket 26903
    626626     */
    627     function test_get_terms_grandparent_zero() {
     627    public function test_get_terms_grandparent_zero() {
    628628        $tax = 'food';
    629629        register_taxonomy( $tax, 'post', array( 'hierarchical' => true ) );
     
    670670     * @ticket 26903
    671671     */
    672     function test_get_terms_seven_levels_deep() {
     672    public function test_get_terms_seven_levels_deep() {
    673673        $tax = 'deep';
    674674        register_taxonomy( $tax, 'post', array( 'hierarchical' => true ) );
     
    706706     * @ticket 27123
    707707     */
    708     function test_get_terms_child_of() {
     708    public function test_get_terms_child_of() {
    709709        $parent = self::factory()->category->create();
    710710        $child  = self::factory()->category->create( array( 'parent' => $parent ) );
     
    723723     * @ticket 46768
    724724     */
    725     function test_get_terms_child_of_fields_id_name() {
     725    public function test_get_terms_child_of_fields_id_name() {
    726726        $parent = self::factory()->category->create();
    727727        $child  = self::factory()->category->create(
     
    762762     * @ticket 46768
    763763     */
    764     function test_get_terms_child_of_fields_id_slug() {
     764    public function test_get_terms_child_of_fields_id_slug() {
    765765        $parent = self::factory()->category->create();
    766766        $child  = self::factory()->category->create(
     
    852852     * @ticket 27123
    853853     */
    854     function test_get_term_children_recursion() {
     854    public function test_get_term_children_recursion() {
    855855        // Assume there is a way to insert a term with the parent pointing to itself.
    856856        // See: https://core.trac.wordpress.org/changeset/15806
Note: See TracChangeset for help on using the changeset viewer.