WordPress.org

Make WordPress Core


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

    r46586 r47122  
    7272
    7373        $fp = fopen( $fullpath, 'x' );
    74         // file already exists?
     74        // File already exists?
    7575        if ( ! $fp ) {
    7676            return false;
    7777        }
    7878
    79         // write some random contents
     79        // Write some random contents.
    8080        $c = rand_str();
    8181        fwrite( $fp, $c );
     
    9292
    9393    function test_unique_filename_is_valid() {
    94         // make sure it produces a valid, writable, unique filename
     94        // Make sure it produces a valid, writable, unique filename.
    9595        $filename = wp_unique_filename( $this->dir, __FUNCTION__ . '.txt' );
    9696
     
    101101
    102102    function test_unique_filename_is_unique() {
    103         // make sure it produces two unique filenames
     103        // Make sure it produces two unique filenames.
    104104        $name = __FUNCTION__;
    105105
     
    109109        $this->assertTrue( $this->is_unique_writable_file( $this->dir, $filename2 ) );
    110110
    111         // the two should be different
     111        // The two should be different.
    112112        $this->assertNotEquals( $filename1, $filename2 );
    113113
     
    120120        $filename = wp_unique_filename( $this->dir, $name . $this->badchars . '.txt' );
    121121
    122         // make sure the bad characters were all stripped out
     122        // Make sure the bad characters were all stripped out.
    123123        $this->assertEquals( $name . '.txt', $filename );
    124124
     
    133133        $filename = wp_unique_filename( $this->dir, $name . '/' . $name . '.txt' );
    134134
    135         // the slash should be removed, i.e. "foofoo.txt"
     135        // The slash should be removed, i.e. "foofoo.txt".
    136136        $this->assertEquals( $name . $name . '.txt', $filename );
    137137
     
    145145        $filename = wp_unique_filename( $this->dir, $name . '.php.txt' );
    146146
    147         // "foo.php.txt" becomes "foo.php_.txt"
     147        // "foo.php.txt" becomes "foo.php_.txt".
    148148        $this->assertEquals( $name . '.php_.txt', $filename );
    149149
Note: See TracChangeset for help on using the changeset viewer.