Changeset 48937 for trunk/tests/phpunit/tests/functions/wpListFilter.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions/wpListFilter.php
r47780 r48937 50 50 'AND' 51 51 ); 52 $this->assert Equals( 2, count( $list ) );52 $this->assertSame( 2, count( $list ) ); 53 53 $this->assertArrayHasKey( 'foo', $list ); 54 54 $this->assertArrayHasKey( 'bar', $list ); … … 64 64 'OR' 65 65 ); 66 $this->assert Equals( 3, count( $list ) );66 $this->assertSame( 3, count( $list ) ); 67 67 $this->assertArrayHasKey( 'foo', $list ); 68 68 $this->assertArrayHasKey( 'bar', $list ); … … 79 79 'NOT' 80 80 ); 81 $this->assert Equals( 1, count( $list ) );81 $this->assertSame( 1, count( $list ) ); 82 82 $this->assertArrayHasKey( 'baz', $list ); 83 83 } … … 93 93 'name' 94 94 ); 95 $this->assert Equals(95 $this->assertSame( 96 96 array( 97 97 'foo' => 'foo', … … 112 112 'name' 113 113 ); 114 $this->assert Equals(114 $this->assertSame( 115 115 array( 116 116 'foo' => 'foo', … … 131 131 'name' 132 132 ); 133 $this->assert Equals( array( 'baz' => 'baz' ), $list );133 $this->assertSame( array( 'baz' => 'baz' ), $list ); 134 134 } 135 135 136 136 function test_wp_list_pluck() { 137 137 $list = wp_list_pluck( $this->object_list, 'name' ); 138 $this->assert Equals(138 $this->assertSame( 139 139 array( 140 140 'foo' => 'foo', … … 146 146 147 147 $list = wp_list_pluck( $this->array_list, 'name' ); 148 $this->assert Equals(148 $this->assertSame( 149 149 array( 150 150 'foo' => 'foo', … … 161 161 function test_wp_list_pluck_index_key() { 162 162 $list = wp_list_pluck( $this->array_list, 'name', 'id' ); 163 $this->assert Equals(163 $this->assertSame( 164 164 array( 165 165 'f' => 'foo', … … 176 176 function test_wp_list_pluck_object_index_key() { 177 177 $list = wp_list_pluck( $this->object_list, 'name', 'id' ); 178 $this->assert Equals(178 $this->assertSame( 179 179 array( 180 180 'f' => 'foo', … … 191 191 function test_wp_list_pluck_missing_index_key() { 192 192 $list = wp_list_pluck( $this->array_list, 'name', 'nonexistent' ); 193 $this->assert Equals(193 $this->assertSame( 194 194 array( 195 195 0 => 'foo', … … 208 208 unset( $array_list['bar']['id'] ); 209 209 $list = wp_list_pluck( $array_list, 'name', 'id' ); 210 $this->assert Equals(210 $this->assertSame( 211 211 array( 212 212 'f' => 'foo', … … 225 225 $mixed_list['bar'] = (object) $mixed_list['bar']; 226 226 $list = wp_list_pluck( $mixed_list, 'name', 'id' ); 227 $this->assert Equals(227 $this->assertSame( 228 228 array( 229 229 'f' => 'foo', … … 248 248 249 249 $list = wp_list_pluck( $ref_list, 'name' ); 250 $this->assert Equals(250 $this->assertSame( 251 251 array( 252 252 'foo', … … 273 273 274 274 $list = wp_list_pluck( $ref_list, 'name', 'id' ); 275 $this->assert Equals(275 $this->assertSame( 276 276 array( 277 277 'f' => 'foo', … … 287 287 function test_filter_object_list_nested_array_and() { 288 288 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND' ); 289 $this->assert Equals( 1, count( $list ) );289 $this->assertSame( 1, count( $list ) ); 290 290 $this->assertArrayHasKey( 'baz', $list ); 291 291 } … … 293 293 function test_filter_object_list_nested_array_not() { 294 294 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'red' ) ), 'NOT' ); 295 $this->assert Equals( 2, count( $list ) );295 $this->assertSame( 2, count( $list ) ); 296 296 $this->assertArrayHasKey( 'bar', $list ); 297 297 $this->assertArrayHasKey( 'baz', $list ); … … 307 307 'OR' 308 308 ); 309 $this->assert Equals( 2, count( $list ) );309 $this->assertSame( 2, count( $list ) ); 310 310 $this->assertArrayHasKey( 'foo', $list ); 311 311 $this->assertArrayHasKey( 'baz', $list ); … … 314 314 function test_filter_object_list_nested_array_or_singular() { 315 315 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'OR' ); 316 $this->assert Equals( 1, count( $list ) );316 $this->assertSame( 1, count( $list ) ); 317 317 $this->assertArrayHasKey( 'baz', $list ); 318 318 } … … 321 321 function test_filter_object_list_nested_array_and_field() { 322 322 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND', 'name' ); 323 $this->assert Equals( array( 'baz' => 'baz' ), $list );323 $this->assertSame( array( 'baz' => 'baz' ), $list ); 324 324 } 325 325 326 326 function test_filter_object_list_nested_array_not_field() { 327 327 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'green' ) ), 'NOT', 'name' ); 328 $this->assert Equals(328 $this->assertSame( 329 329 array( 330 330 'foo' => 'foo', … … 345 345 'name' 346 346 ); 347 $this->assert Equals(347 $this->assertSame( 348 348 array( 349 349 'foo' => 'foo',
Note: See TracChangeset
for help on using the changeset viewer.