Make WordPress Core

Ticket #29785: phpunit_test_countUsers.patch

File phpunit_test_countUsers.patch, 1.2 KB (added by dots, 7 years ago)

Added the phpunit test patch

  • countUsers.php

     
    3232                $subscriber = self::factory()->user->create( array(
    3333                        'role' => 'subscriber',
    3434                ) );
     35                $spam = self::factory()->user->create( array(
     36                        'role' => 'spam',
     37                ) );
    3538                $none = self::factory()->user->create( array(
    3639                        'role' => '',
    3740                ) );
     
    4952                        'author'        => 1,
    5053                        'contributor'   => 1,
    5154                        'subscriber'    => 1,
     55                        'spam'                  => 1,
    5256                        'none'          => 2,
    5357                ), $count['avail_roles'] );
    5458
     
    8286                $subscriber = self::factory()->user->create( array(
    8387                        'role' => 'subscriber',
    8488                ) );
     89                $spam = self::factory()->user->create( array(
     90                        'role' => 'spam',
     91                ) );
    8592                $none = self::factory()->user->create( array(
    8693                        'role' => '',
    8794                ) );
  • multisite.php

     
    199199        function test_is_user_spammy() {
    200200                $user_id = self::factory()->user->create( array(
    201201                        'role' => 'author',
    202                         'user_login' => 'testuser1',
     202                        'user_login' => 'spam',
    203203                ) );
    204204
    205205                $spam_username = (string) $user_id;