Changeset 51668
- Timestamp:
- 08/26/2021 04:50:02 PM (2 years ago)
- Location:
- trunk/tests/phpunit/tests/functions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions/wpFilterObjectList.php
r51665 r51668 11 11 public $array_list = array(); 12 12 13 function set_up() {13 public function set_up() { 14 14 parent::set_up(); 15 15 $this->array_list['foo'] = array( … … 42 42 } 43 43 44 function test_filter_object_list_and() {44 public function test_filter_object_list_and() { 45 45 $list = wp_filter_object_list( 46 46 $this->object_list, … … 56 56 } 57 57 58 function test_filter_object_list_or() {58 public function test_filter_object_list_or() { 59 59 $list = wp_filter_object_list( 60 60 $this->object_list, … … 71 71 } 72 72 73 function test_filter_object_list_not() {73 public function test_filter_object_list_not() { 74 74 $list = wp_filter_object_list( 75 75 $this->object_list, … … 84 84 } 85 85 86 function test_filter_object_list_and_field() {86 public function test_filter_object_list_and_field() { 87 87 $list = wp_filter_object_list( 88 88 $this->object_list, … … 103 103 } 104 104 105 function test_filter_object_list_or_field() {105 public function test_filter_object_list_or_field() { 106 106 $list = wp_filter_object_list( 107 107 $this->object_list, … … 122 122 } 123 123 124 function test_filter_object_list_not_field() {124 public function test_filter_object_list_not_field() { 125 125 $list = wp_filter_object_list( 126 126 $this->object_list, … … 135 135 } 136 136 137 function test_filter_object_list_nested_array_and() {137 public function test_filter_object_list_nested_array_and() { 138 138 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND' ); 139 139 $this->assertCount( 1, $list ); … … 141 141 } 142 142 143 function test_filter_object_list_nested_array_not() {143 public function test_filter_object_list_nested_array_not() { 144 144 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'red' ) ), 'NOT' ); 145 145 $this->assertCount( 2, $list ); … … 148 148 } 149 149 150 function test_filter_object_list_nested_array_or() {150 public function test_filter_object_list_nested_array_or() { 151 151 $list = wp_filter_object_list( 152 152 $this->object_list, … … 162 162 } 163 163 164 function test_filter_object_list_nested_array_or_singular() {164 public function test_filter_object_list_nested_array_or_singular() { 165 165 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'OR' ); 166 166 $this->assertCount( 1, $list ); … … 168 168 } 169 169 170 function test_filter_object_list_nested_array_and_field() {170 public function test_filter_object_list_nested_array_and_field() { 171 171 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND', 'name' ); 172 172 $this->assertSame( array( 'baz' => 'baz' ), $list ); 173 173 } 174 174 175 function test_filter_object_list_nested_array_not_field() {175 public function test_filter_object_list_nested_array_not_field() { 176 176 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'green' ) ), 'NOT', 'name' ); 177 177 $this->assertSame( … … 184 184 } 185 185 186 function test_filter_object_list_nested_array_or_field() {186 public function test_filter_object_list_nested_array_or_field() { 187 187 $list = wp_filter_object_list( 188 188 $this->object_list, -
trunk/tests/phpunit/tests/functions/wpListPluck.php
r51663 r51668 11 11 public $array_list = array(); 12 12 13 function set_up() {13 public function set_up() { 14 14 parent::set_up(); 15 15 $this->array_list['foo'] = array( … … 42 42 } 43 43 44 function test_wp_list_pluck_array_and_object() {44 public function test_wp_list_pluck_array_and_object() { 45 45 $list = wp_list_pluck( $this->object_list, 'name' ); 46 46 $this->assertSame( … … 67 67 * @ticket 28666 68 68 */ 69 function test_wp_list_pluck_index_key() {69 public function test_wp_list_pluck_index_key() { 70 70 $list = wp_list_pluck( $this->array_list, 'name', 'id' ); 71 71 $this->assertSame( … … 82 82 * @ticket 28666 83 83 */ 84 function test_wp_list_pluck_object_index_key() {84 public function test_wp_list_pluck_object_index_key() { 85 85 $list = wp_list_pluck( $this->object_list, 'name', 'id' ); 86 86 $this->assertSame( … … 97 97 * @ticket 28666 98 98 */ 99 function test_wp_list_pluck_missing_index_key() {99 public function test_wp_list_pluck_missing_index_key() { 100 100 $list = wp_list_pluck( $this->array_list, 'name', 'nonexistent' ); 101 101 $this->assertSame( … … 112 112 * @ticket 28666 113 113 */ 114 function test_wp_list_pluck_partial_missing_index_key() {114 public function test_wp_list_pluck_partial_missing_index_key() { 115 115 $array_list = $this->array_list; 116 116 unset( $array_list['bar']['id'] ); … … 129 129 * @ticket 28666 130 130 */ 131 function test_wp_list_pluck_mixed_index_key() {131 public function test_wp_list_pluck_mixed_index_key() { 132 132 $mixed_list = $this->array_list; 133 133 $mixed_list['bar'] = (object) $mixed_list['bar']; … … 146 146 * @ticket 16895 147 147 */ 148 function test_wp_list_pluck_containing_references() {148 public function test_wp_list_pluck_containing_references() { 149 149 $ref_list = array( 150 150 & $this->object_list['foo'], … … 171 171 * @ticket 16895 172 172 */ 173 function test_wp_list_pluck_containing_references_keys() {173 public function test_wp_list_pluck_containing_references_keys() { 174 174 $ref_list = array( 175 175 & $this->object_list['foo'],
Note: See TracChangeset
for help on using the changeset viewer.