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/feed/atom.php

    r46586 r47122  
    1818     */
    1919    public static function wpSetUpBeforeClass( $factory ) {
    20         // Create a user
     20        // Create a user.
    2121        self::$user_id = $factory->user->create(
    2222            array(
     
    2727        );
    2828
    29         // Create a taxonomy
     29        // Create a taxonomy.
    3030        self::$category = self::factory()->category->create_and_get(
    3131            array(
     
    3737        $count = get_option( 'posts_per_rss' ) + 1;
    3838
    39         // Create a few posts
     39        // Create a few posts.
    4040        self::$posts = $factory->post->create_many(
    4141            $count,
     
    4747        );
    4848
    49         // Assign a category to those posts
     49        // Assign a category to those posts.
    5050        foreach ( self::$posts as $post ) {
    5151            wp_set_object_terms( $post, self::$category->slug, 'category' );
     
    141141        $this->assertCount( $this->post_count, $entries );
    142142
    143         // We Really only need to test X number of entries unless the content is different
     143        // We really only need to test X number of entries unless the content is different.
    144144        $entries = array_slice( $entries, 1 );
    145145
     
    147147        foreach ( $entries as $key => $entry ) {
    148148
    149             // Get post for comparison
     149            // Get post for comparison.
    150150            $id = xml_find( $entries[ $key ]['child'], 'id' );
    151151            preg_match( '/\?p=(\d+)/', $id[0]['content'], $matches );
    152152            $post = get_post( $matches[1] );
    153153
    154             // Author
     154            // Author.
    155155            $author = xml_find( $entries[ $key ]['child'], 'author', 'name' );
    156156            $user   = new WP_User( $post->post_author );
    157157            $this->assertEquals( $user->display_name, $author[0]['content'] );
    158158
    159             // Title
     159            // Title.
    160160            $title = xml_find( $entries[ $key ]['child'], 'title' );
    161161            $this->assertEquals( $post->post_title, $title[0]['content'] );
    162162
    163             // Link rel="alternate"
     163            // Link rel="alternate".
    164164            $link_alts = xml_find( $entries[ $key ]['child'], 'link' );
    165165            foreach ( $link_alts as $link_alt ) {
     
    169169            }
    170170
    171             // Id
     171            // ID.
    172172            $guid = xml_find( $entries[ $key ]['child'], 'id' );
    173173            $this->assertEquals( $post->guid, $id[0]['content'] );
    174174
    175             // Updated
     175            // Updated.
    176176            $updated = xml_find( $entries[ $key ]['child'], 'updated' );
    177177            $this->assertEquals( strtotime( $post->post_modified_gmt ), strtotime( $updated[0]['content'] ) );
    178178
    179             // Published
     179            // Published.
    180180            $published = xml_find( $entries[ $key ]['child'], 'published' );
    181181            $this->assertEquals( strtotime( $post->post_date_gmt ), strtotime( $published[0]['content'] ) );
    182182
    183             // Category
     183            // Category.
    184184            foreach ( get_the_category( $post->ID ) as $term ) {
    185185                $terms[] = $term->name;
     
    191191            unset( $terms );
    192192
    193             // Content
     193            // Content.
    194194            if ( ! $this->excerpt_only ) {
    195195                $content = xml_find( $entries[ $key ]['child'], 'content' );
     
    197197            }
    198198
    199             // Link rel="replies"
     199            // Link rel="replies".
    200200            $link_replies = xml_find( $entries[ $key ]['child'], 'link' );
    201201            foreach ( $link_replies as $link_reply ) {
Note: See TracChangeset for help on using the changeset viewer.