Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/query/taxQuery.php

    r46586 r47122  
    995995
    996996        /**
     997         * An empty tax query should return an empty array, not all posts.
     998         *
    997999         * @ticket 20604
    9981000         */
    9991001        public function test_tax_query_relation_or_both_clauses_empty_terms() {
    1000                 // An empty tax query should return an empty array, not all posts.
    1001 
    10021002                self::factory()->post->create_many( 2 );
    10031003
     
    10301030
    10311031        /**
     1032         * An empty tax query should return an empty array, not all posts.
     1033         *
    10321034         * @ticket 20604
    10331035         */
    10341036        public function test_tax_query_relation_or_one_clause_empty_terms() {
    1035                 // An empty tax query should return an empty array, not all posts.
    1036 
    10371037                self::factory()->post->create_many( 2 );
    10381038
     
    13021302                $tags = array();
    13031303
    1304                 // need term_taxonomy_ids in addition to term_ids, so no factory
     1304                // Need term_taxonomy_ids in addition to term_ids, so no factory.
    13051305                for ( $i = 0; $i < 5; $i++ ) {
    13061306                        $cats[ $i ] = wp_insert_term( 'category-' . $i, 'category' );
    13071307                        $tags[ $i ] = wp_insert_term( 'tag-' . $i, 'post_tag' );
    13081308
    1309                         // post 0 gets all terms
     1309                        // Post 0 gets all terms.
    13101310                        wp_set_object_terms( $posts[0], array( $cats[ $i ]['term_id'] ), 'category', true );
    13111311                        wp_set_object_terms( $posts[0], array( $tags[ $i ]['term_id'] ), 'post_tag', true );
     
    13951395                        array(
    13961396                                'tax_query' => array(
    1397                                         // Empty terms mean that this one should be skipped
     1397                                        // Empty terms mean that this one should be skipped.
    13981398                                        array(
    13991399                                                'taxonomy' => 'bar',
     
    14011401                                        ),
    14021402
    1403                                         // Category and post tags should be skipped
     1403                                        // Category and post tags should be skipped.
    14041404                                        array(
    14051405                                                'taxonomy' => 'category',
     
    15191519                        array(
    15201520                                'tax_query' => array(
    1521                                         // Non-category should be skipped
     1521                                        // Non-category should be skipped.
    15221522                                        array(
    15231523                                                'taxonomy' => 'foo',
     
    15251525                                        ),
    15261526
    1527                                         // Empty terms mean that this one should be skipped
     1527                                        // Empty terms mean that this one should be skipped.
    15281528                                        array(
    15291529                                                'taxonomy' => 'category',
     
    15311531                                        ),
    15321532
    1533                                         // Category and post tags should be skipped
     1533                                        // Category and post tags should be skipped.
    15341534                                        array(
    15351535                                                'taxonomy' => 'category',
     
    15661566                        array(
    15671567                                'tax_query' => array(
    1568                                         // Non-tag should be skipped
     1568                                        // Non-tag should be skipped.
    15691569                                        array(
    15701570                                                'taxonomy' => 'foo',
     
    15721572                                        ),
    15731573
    1574                                         // Empty terms mean that this one should be skipped
     1574                                        // Empty terms mean that this one should be skipped.
    15751575                                        array(
    15761576                                                'taxonomy' => 'post_tag',
     
    15781578                                        ),
    15791579
    1580                                         // Category and post tags should be skipped
     1580                                        // Category and post tags should be skipped.
    15811581                                        array(
    15821582                                                'taxonomy' => 'post_tag',
Note: See TracChangeset for help on using the changeset viewer.