WordPress.org

Make WordPress Core

Changeset 1216 in tests


Ignore:
Timestamp:
02/15/13 17:58:04 (14 months ago)
Author:
SergeyBiryukov
Message:

Test that is_user_spammy() properly recognizes a numeric username. props bananastalktome. see #23192. see #23190.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/ms.php

    r1094 r1216  
    881881        update_site_option( 'ms_files_rewriting', 0 ); 
    882882    } 
     883 
     884    /** 
     885     * @ticket 23192 
     886     */ 
     887    function test_is_user_spammy() { 
     888        $user_id = $this->factory->user->create( array( 
     889            'role' => 'author', 
     890            'user_login' => 'testuser1', 
     891        ) ); 
     892 
     893        $spam_username = (string) $user_id; 
     894        $spam_user_id = $this->factory->user->create( array( 
     895            'role' => 'author', 
     896            'user_login' => $spam_username, 
     897        ) ); 
     898        update_user_status( $spam_user_id, 'spam', '1' ); 
     899         
     900        $this->assertTrue( is_user_spammy( $spam_username ) ); 
     901        $this->assertFalse( is_user_spammy( 'testuser1' ) ); 
     902    } 
     903 
    883904} 
    884905 
Note: See TracChangeset for help on using the changeset viewer.