Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/14/2014 02:01:18 PM (12 years ago)
Author:
boonebgorges
Message:

In automated tests, move user creation to a proper factory method.

BP user creation requires that a couple of extra pieces of data be set up
(last activity, display name, etc). So we previously had a wrapper in
BP_UnitTestCase called create_user() that performed the extra setup.
However, the wrapper made it impossible to use create_user() statically,
because the user_login and user_email iterator was not persistent from call to
call. (The create_user() syntax is also a break with the rest of our unit
tests, which is not ideal.)

This changeset introduces BP_UnitTest_Factory_For_User, which reproduces the
customizations of create_user(), but in a proper factory method. All
instances of create_user() throughout the test suite have also been replaced.

See #6009.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/xprofile/cache.php

    r8958 r9139  
    1010         */
    1111        public function test_bp_xprofile_update_meta_cache() {
    12                 $u = $this->create_user();
     12                $u = $this->factory->user->create();
    1313                $g = $this->factory->xprofile_group->create();
    1414                $f = $this->factory->xprofile_field->create( array(
     
    6565         */
    6666        public function test_bp_has_profile_meta_cache() {
    67                 $u = $this->create_user();
     67                $u = $this->factory->user->create();
    6868                $g = $this->factory->xprofile_group->create();
    6969                $f = $this->factory->xprofile_field->create( array(
     
    119119         */
    120120        public function test_bp_has_profile_meta_cache_update_meta_cache_false() {
    121                 $u = $this->create_user();
     121                $u = $this->factory->user->create();
    122122                $g = $this->factory->xprofile_group->create();
    123123                $f = $this->factory->xprofile_field->create( array(
Note: See TracChangeset for help on using the changeset viewer.