Skip to content

Commit 5b86a39

Browse files
committed
Fix a count() error in one of the unit tests
1 parent 562dbc0 commit 5b86a39

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test-navwalker.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,10 @@ function test_seporate_linkmods_and_icons_from_classes_linkmods() {
399399
// icon_classes should be empty.
400400
$this->assertTrue( empty( $icon_classes ) );
401401

402+
$num_of_items_left = count( $this->valid_linkmod_classes ) - count( $linkmod_classes ) - count( $this->valid_linkmod_typeflags );
402403
// the number of items inside updated array should match [what we started with - minus the linkmods for inside dropdowns].
403-
$this->assertTrue(
404-
(bool) count( ( $this->valid_linkmod_classes ) === ( count( $linkmod_classes ) - count( $this->valid_linkmod_typeflags ) ) ),
405-
"Seems that the linkmod classes are not catptured properly when outside of dropdowns... \nvalid: \n" . print_r( $this->valid_linkmod_classes, true ) . "\nreturned: \n" . print_r( $linkmod_classes, true ) . "\n" . count( $this->valid_linkmod_classes ) . ' ' . count( $linkmod_classes ) . ' ' . count( $this->valid_linkmod_typeflags ) );
404+
$this->assertNotTrue( (bool) $num_of_items_left,
405+
"Seems that the linkmod classes are not catptured properly when outside of dropdowns... \nvalid: \n" . print_r( $this->valid_linkmod_classes, true ) . "\nreturned: \n" . print_r( $linkmod_classes, true ) );
406406
// get the differences between the original classes and updated classes.
407407
$linkmod_differences = array_diff( $this->valid_linkmod_classes, $linkmod_classes, $this->valid_linkmod_typeflags );
408408

0 commit comments

Comments
 (0)