Changeset 431 in tests for wp-testcase/test_includes_functions.php
- Timestamp:
- 08/25/2011 06:19:46 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-testcase/test_includes_functions.php
r410 r431 254 254 class TestListFilter extends WPTestCase { 255 255 var $object_list = array(); 256 var $array_list = array(); 256 257 257 258 function setUp() { 258 $this->object_list['foo'] = (object) array( 'name' => 'foo', 'field1' => true, 'field2' => true, 'field3' => true ); 259 $this->object_list['bar'] = (object) array( 'name' => 'bar', 'field1' => true, 'field2' => true, 'field3' => false ); 260 $this->object_list['baz'] = (object) array( 'name' => 'baz', 'field1' => true, 'field2' => false, 'field3' => false ); 259 $this->array_list['foo'] = array( 'name' => 'foo', 'field1' => true, 'field2' => true, 'field3' => true ); 260 $this->array_list['bar'] = array( 'name' => 'bar', 'field1' => true, 'field2' => true, 'field3' => false ); 261 $this->array_list['baz'] = array( 'name' => 'baz', 'field1' => true, 'field2' => false, 'field3' => false ); 262 foreach ( $this->array_list as $key => $value ) { 263 $this->object_list[ $key ] = (object) $value; 264 } 261 265 } 262 266 … … 298 302 $this->assertEquals( 1, count( $list ) ); 299 303 $this->assertEquals( array( 'baz' => 'baz' ) , $list ); 304 } 305 306 function test_wp_list_pluck() { 307 $list = wp_list_pluck( $this->object_list, 'name' ); 308 $this->assertEquals( array( 'foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz' ) , $list ); 309 310 $list = wp_list_pluck( $this->array_list, 'name' ); 311 $this->assertEquals( array( 'foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz' ) , $list ); 300 312 } 301 313 }
Note: See TracChangeset
for help on using the changeset viewer.