Make WordPress Core


Ignore:
Timestamp:
10/17/2015 06:02:16 PM (10 years ago)
Author:
wonderboymusic
Message:

Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop.

Props nerrad, wonderboymusic.
See #30017, #33968.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/multisite/wpmuValidateUserSignup.php

    r35225 r35242  
    6464
    6565    public function test_should_fail_for_existing_user_name() {
    66         $u = self::$factory->user->create( array( 'user_login' => 'foo123' ) );
     66        $u = self::factory()->user->create( array( 'user_login' => 'foo123' ) );
    6767        $v = wpmu_validate_user_signup( 'foo123', 'foo@example.com' );
    6868        $this->assertContains( 'user_name', $v['errors']->get_error_codes() );
     
    7070
    7171    public function test_should_fail_for_existing_user_email() {
    72         $u = self::$factory->user->create( array( 'user_email' => 'foo@example.com' ) );
     72        $u = self::factory()->user->create( array( 'user_email' => 'foo@example.com' ) );
    7373        $v = wpmu_validate_user_signup( 'foo123', 'foo@example.com' );
    7474        $this->assertContains( 'user_email', $v['errors']->get_error_codes() );
Note: See TracChangeset for help on using the changeset viewer.