Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (5 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/option/transient.php

    r46586 r47122  
    9494     */
    9595    function test_nonexistent_key_dont_delete_if_false() {
    96         // Create a bogus a transient
     96        // Create a bogus a transient.
    9797        $key = 'test_transient';
    9898        set_transient( $key, 'test', 60 * 10 );
    9999        $this->assertEquals( 'test', get_transient( $key ) );
    100100
    101         // Useful variables for tracking
     101        // Useful variables for tracking.
    102102        $transient_timeout = '_transient_timeout_' . $key;
    103103
    104         // Mock an action for tracking action calls
     104        // Mock an action for tracking action calls.
    105105        $a = new MockAction();
    106106
    107         // Make sure the timeout option returns false
     107        // Make sure the timeout option returns false.
    108108        add_filter( 'option_' . $transient_timeout, '__return_false' );
    109109
    110         // Add some actions to make sure options are _not_ deleted
     110        // Add some actions to make sure options are _not_ deleted.
    111111        add_action( 'delete_option', array( $a, 'action' ) );
    112112
    113         // Act
     113        // Act.
    114114        get_transient( $key );
    115115
    116         // Make sure delete option was not called for both the transient and the timeout
     116        // Make sure 'delete_option' was not called for both the transient and the timeout.
    117117        $this->assertEquals( 0, $a->get_call_count() );
    118118    }
     
    122122     */
    123123    function test_nonexistent_key_old_timeout() {
    124         // Create a transient
     124        // Create a transient.
    125125        $key = 'test_transient';
    126126        set_transient( $key, 'test', 60 * 10 );
    127127        $this->assertEquals( 'test', get_transient( $key ) );
    128128
    129         // Make sure the timeout option returns false
     129        // Make sure the timeout option returns false.
    130130        $timeout          = '_transient_timeout_' . $key;
    131131        $transient_option = '_transient_' . $key;
    132132        add_filter( 'option_' . $timeout, '__return_zero' );
    133133
    134         // Mock an action for tracking action calls
     134        // Mock an action for tracking action calls.
    135135        $a = new MockAction();
    136136
    137         // Add some actions to make sure options are deleted
     137        // Add some actions to make sure options are deleted.
    138138        add_action( 'delete_option', array( $a, 'action' ) );
    139139
    140         // Act
     140        // Act.
    141141        get_transient( $key );
    142142
    143         // Make sure delete option was called for both the transient and the timeout
     143        // Make sure 'delete_option' was called for both the transient and the timeout.
    144144        $this->assertEquals( 2, $a->get_call_count() );
    145145
Note: See TracChangeset for help on using the changeset viewer.