Make WordPress Core


Ignore:
Timestamp:
08/01/2014 06:27:16 PM (12 years ago)
Author:
wonderboymusic
Message:

Account for WP_IMPORTING being defined in the unit tests added in [29339] when all tests are run.

Glory, glory hallelujah.

Fixes #28315.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user.php

    r29339 r29341  
    633633         */
    634634        function test_user_meta_error() {
    635                 $this->factory->user->create( array( 'user_email' => 'taco@burrito.com' ) );
    636                 $id = $this->factory->user->create( array( 'user_email' => 'taco@burrito.com' ) );
    637 
    638                 $this->assertWPError( $id );
    639                 @update_user_meta( $id, 'key', 'value' );
     635                $id1 = wp_insert_user( array(
     636                        'user_login' => rand_str(),
     637                        'user_pass' => 'password',
     638                        'user_email' => 'taco@burrito.com',
     639                ) );
     640                $this->assertEquals( $id1, email_exists( 'taco@burrito.com' ) );
     641
     642                $id2 = wp_insert_user( array(
     643                        'user_login' => rand_str(),
     644                        'user_pass' => 'password',
     645                        'user_email' => 'taco@burrito.com',
     646                ) );
     647
     648                if ( ! defined( 'WP_IMPORTING' ) ) {
     649                        $this->assertWPError( $id2 );
     650                }
     651
     652                @update_user_meta( $id2, 'key', 'value' );
    640653
    641654                $metas = array_keys( get_user_meta( 1 ) );
Note: See TracChangeset for help on using the changeset viewer.