Skip to:
Content

BuddyPress.org

Ticket #5834: 5834.cant-trust-first-signup.patch

File 5834.cant-trust-first-signup.patch, 2.7 KB (added by imath, 12 years ago)

wow cannot trust the first signup !

  • tests/phpunit/testcases/members/class-bp-signup.php

    diff --git tests/phpunit/testcases/members/class-bp-signup.php tests/phpunit/testcases/members/class-bp-signup.php
    index 18ab33f..e194e2e 100644
    class BP_Tests_BP_Signup extends BP_UnitTestCase {  
    251251         * @group activate
    252252         */
    253253        public function test_activate_user_accounts_with_blogs() {
    254                 global $wpdb, $current_site;
     254                global $wpdb, $current_site, $base;
    255255
    256256                if ( ! is_multisite() ) {
    257257                        return;
    class BP_Tests_BP_Signup extends BP_UnitTestCase {  
    259259
    260260                $signups = array();
    261261
    262                 $signups['blogone'] = $this->factory->signup->create( array(
    263                         'user_login'     => 'blogone',
     262                // Can't trust this first signup :(
     263                $signups['testpath1'] = $this->factory->signup->create( array(
     264                        'user_login'     => 'testpath1',
    264265                        'user_email'     => 'blogone@example.com',
    265                         'domain'         => $current_site->domain,
    266                         'path'           => '/blogone/',
    267                         'title'          => 'Blog One',
     266                        'domain'         => '',
     267                        'path'           => '',
     268                        'title'          => '',
    268269                        'activation_key' => 'activationkeyblogone',
    269270                ) );
    270271
    271272                $signups['blogtwo'] = $this->factory->signup->create( array(
    272273                        'user_login'     => 'blogtwo',
    273274                        'user_email'     => 'blogtwo@example.com',
    274                         'domain'         => '',
    275                         'path'           => '',
    276                         'title'          => '',
     275                        'domain'         => $current_site->domain,
     276                        'path'           => $base . 'blogtwo',
     277                        'title'          => 'Blog Two',
    277278                        'activation_key' => 'activationkeyblogtwo',
    278279                ) );
    279280
    280281                $signups['blogthree'] = $this->factory->signup->create( array(
    281282                        'user_login'     => 'blogthree',
    282283                        'user_email'     => 'blogthree@example.com',
    283                         'domain'         => $current_site->domain,
    284                         'path'           => '/blogthree/',
    285                         'title'          => 'Blog Three',
     284                        'domain'         => '',
     285                        'path'           => '',
     286                        'title'          => '',
    286287                        'activation_key' => 'activationkeyblogthree',
    287288                ) );
    288289
     290                $signups['blogfour'] = $this->factory->signup->create( array(
     291                        'user_login'     => 'blogfour',
     292                        'user_email'     => 'blogfour@example.com',
     293                        'domain'         => $current_site->domain,
     294                        'path'           => $base . 'blogfour',
     295                        'title'          => 'Blog Four',
     296                        'activation_key' => 'activationkeyblogfour',
     297                ) );
     298
    289299                // Neutralize db errors
    290300                $suppress = $wpdb->suppress_errors();
    291301
    class BP_Tests_BP_Signup extends BP_UnitTestCase {  
    306316                $blogs = array();
    307317
    308318                foreach ( $users as $path => $user  ) {
     319                        // Can't trust this first signup :(
     320                        if ( 'testpath1' == $path ) {
     321                                continue;
     322                        }
     323
    309324                        $blogs[ $path ] = get_active_blog_for_user( $user->ID );
    310325                }
    311326