Changeset 11737 for trunk/tests/phpunit/testcases/groups/types.php
- Timestamp:
- 11/03/2017 07:44:10 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/groups/types.php
r11144 r11737 107 107 108 108 public function test_groups_set_type_success() { 109 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );109 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 110 110 bp_groups_register_group_type( 'foo' ); 111 111 … … 114 114 115 115 public function test_groups_set_type_should_remove_type_when_passing_an_empty_value() { 116 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );116 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 117 117 bp_groups_register_group_type( 'foo' ); 118 118 bp_groups_set_group_type( $g, 'foo' ); … … 126 126 127 127 public function test_groups_get_type_with_default_value_for_single() { 128 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );128 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 129 129 bp_groups_register_group_type( 'foo' ); 130 130 bp_groups_register_group_type( 'bar' ); … … 136 136 137 137 public function test_groups_get_type_with_single_true() { 138 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );138 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 139 139 bp_groups_register_group_type( 'foo' ); 140 140 bp_groups_register_group_type( 'bar' ); … … 146 146 147 147 public function test_groups_get_type_with_single_false() { 148 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );148 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 149 149 bp_groups_register_group_type( 'foo' ); 150 150 bp_groups_register_group_type( 'bar' ); … … 156 156 157 157 public function test_groups_get_type_should_return_false_when_no_value_is_found() { 158 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );158 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 159 159 bp_groups_register_group_type( 'foo' ); 160 160 … … 171 171 172 172 public function test_groups_remove_type_should_return_false_when_group_is_not_of_provided_type() { 173 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );173 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 174 174 bp_groups_register_group_type( 'foo' ); 175 175 bp_groups_register_group_type( 'bar' ); … … 181 181 182 182 public function tests_groups_remove_type_should_return_true_on_successful_deletion() { 183 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );183 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 184 184 bp_groups_register_group_type( 'foo' ); 185 185 bp_groups_register_group_type( 'bar' ); … … 206 206 207 207 public function test_groups_has_type_should_return_false_when_group_is_not_of_provided_type() { 208 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );208 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 209 209 bp_groups_register_group_type( 'foo' ); 210 210 bp_groups_register_group_type( 'bar' ); … … 215 215 216 216 public function test_groups_has_type_should_return_true_on_success() { 217 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );217 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 218 218 bp_groups_register_group_type( 'foo' ); 219 219 bp_groups_register_group_type( 'bar' ); … … 229 229 */ 230 230 public function test_groups_get_type_should_hit_cache() { 231 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );231 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 232 232 bp_groups_register_group_type( 'foo' ); 233 233 bp_groups_set_group_type( $g, 'foo' ); … … 254 254 255 255 public function test_groups_get_type_should_not_return_unregistered_types() { 256 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );256 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 257 257 bp_groups_register_group_type( 'foo' ); 258 258 bp_groups_set_group_type( $g, 'foo' ); … … 291 291 292 292 public function test_bp_groups_set_group_type_should_remove_types_when_passing_an_empty_value() { 293 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );293 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 294 294 bp_groups_register_group_type( 'foo' ); 295 295 bp_groups_set_group_type( $g, 'foo' ); … … 303 303 304 304 public function test_bp_groups_set_group_type_should_set_multiple_types_when_passing_array_of_types() { 305 $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );305 $g = self::factory()->group->create( array( 'creator_id' => self::$u1 ) ); 306 306 bp_groups_register_group_type( 'foo' ); 307 307 bp_groups_register_group_type( 'bar' );
Note: See TracChangeset
for help on using the changeset viewer.