Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2017 07:44:10 PM (4 years ago)
Author:
boonebgorges
Message:

Use static factory method throughout PHPUnit tests.

See #7620.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/xprofile/class-bp-xprofile-field.php

    r11253 r11737  
    1010     */
    1111    public function test_can_delete_save() {
    12         $group = $this->factory->xprofile_group->create();
    13         $field = $this->factory->xprofile_field->create( array(
     12        $group = self::factory()->xprofile_group->create();
     13        $field = self::factory()->xprofile_field->create( array(
    1414            'field_group_id' => $group,
    1515        ) );
     
    2727     */
    2828    public function test_get_id_from_name_field_name_option_value_conflict() {
    29         $group = $this->factory->xprofile_group->create();
     29        $group = self::factory()->xprofile_group->create();
    3030
    3131        // force some checkbox options for our profile field
     
    3636
    3737        // checkbox field
    38         $f1 = $this->factory->xprofile_field->create( array(
     38        $f1 = self::factory()->xprofile_field->create( array(
    3939            'field_group_id' => $group,
    4040            'type' => 'checkbox',
     
    4343
    4444        // textbox field with the same name as our checkbox value
    45         $f2 = $this->factory->xprofile_field->create( array(
     45        $f2 = self::factory()->xprofile_field->create( array(
    4646            'field_group_id' => $group,
    4747            'type' => 'textbox',
     
    128128        global $wpdb;
    129129
    130         $group = $this->factory->xprofile_group->create();
    131         $field = $this->factory->xprofile_field->create( array(
     130        $group = self::factory()->xprofile_group->create();
     131        $field = self::factory()->xprofile_field->create( array(
    132132            'field_group_id' => $group,
    133133        ) );
     
    155155        global $wpdb;
    156156
    157         $group = $this->factory->xprofile_group->create();
    158         $field = $this->factory->xprofile_field->create( array(
     157        $group = self::factory()->xprofile_group->create();
     158        $field = self::factory()->xprofile_field->create( array(
    159159            'field_group_id' => $group,
    160160        ) );
     
    189189     */
    190190    public function test_update_position_should_invalidate_cache() {
    191         $group = $this->factory->xprofile_group->create();
    192         $field = $this->factory->xprofile_field->create( array(
     191        $group = self::factory()->xprofile_group->create();
     192        $field = self::factory()->xprofile_field->create( array(
    193193            'field_group_id' => $group,
    194194        ) );
     
    210210     */
    211211    public function test_empty_datebox_fields_should_not_return_unix_epoch() {
    212         $user  = $this->factory->user->create( array( 'role' => 'subscriber' ) );
    213         $group = $this->factory->xprofile_group->create();
    214         $field = $this->factory->xprofile_field->create( array(
     212        $user  = self::factory()->user->create( array( 'role' => 'subscriber' ) );
     213        $group = self::factory()->xprofile_group->create();
     214        $field = self::factory()->xprofile_field->create( array(
    215215            'field_group_id' => $group,
    216216            'type' => 'datebox',
Note: See TracChangeset for help on using the changeset viewer.