@@ -39,6 +39,7 @@ public function setUp() {
3939 $ this ->valid_linkmod_typeflags = array (
4040 'dropdown-header ' ,
4141 'dropdown-divider ' ,
42+ 'dropdown-item-text '
4243 );
4344
4445 // array of all possible linkmods, including the valid typeflags.
@@ -592,6 +593,8 @@ public function test_linkmod_elements_open_and_close_successfully() {
592593 $ this ->assertNotEmpty ( $ header_open , 'Got empty string for opener of ' . $ this ->valid_linkmod_typeflags [0 ] );
593594 $ divider_open = $ method_open ->invokeArgs ( $ wp_bootstrap_navwalker , array ( $ this ->valid_linkmod_typeflags [1 ], 'stringOfAttributes ' ) );
594595 $ this ->assertNotEmpty ( $ divider_open , 'Got empty string for opener of ' . $ this ->valid_linkmod_typeflags [1 ] );
596+ $ text_open = $ method_open ->invokeArgs ( $ wp_bootstrap_navwalker , array ( $ this ->valid_linkmod_typeflags [2 ], 'stringOfAttributes ' ) );
597+ $ this ->assertNotEmpty ( $ divider_open , 'Got empty string for opener of ' . $ this ->valid_linkmod_typeflags [2 ] );
595598
596599 // test that that an unknown linkmod type being passed results in no output.
597600 $ nonexistent_linkmod_type_open = $ method_open ->invokeArgs ( $ wp_bootstrap_navwalker , array ( 'nonexistentlinkmodtype ' , 'stringOfAttributes ' ) );
@@ -605,21 +608,30 @@ public function test_linkmod_elements_open_and_close_successfully() {
605608 $ this ->assertNotEmpty ( $ header_close , 'Got empty string for closer of ' . $ this ->valid_linkmod_typeflags [0 ] );
606609 $ divider_close = $ method_close ->invokeArgs ( $ wp_bootstrap_navwalker , array ( $ this ->valid_linkmod_typeflags [1 ] ) );
607610 $ this ->assertNotEmpty ( $ divider_close , 'Got empty string for closer of ' . $ this ->valid_linkmod_typeflags [1 ] );
611+ $ text_close = $ method_close ->invokeArgs ( $ wp_bootstrap_navwalker , array ( $ this ->valid_linkmod_typeflags [2 ] ) );
612+ $ this ->assertNotEmpty ( $ divider_close , 'Got empty string for closer of ' . $ this ->valid_linkmod_typeflags [2 ] );
608613
609614 // test that that an unknown linkmod type being passed results in no output.
610615 $ nonexistent_linkmod_type_close = $ method_open ->invokeArgs ( $ wp_bootstrap_navwalker , array ( 'nonexistentlinkmodtype ' ) );
611616 $ this ->assertEmpty ( $ nonexistent_linkmod_type_close , 'Expected empty string when using non-existent linkmod type. ' );
612617
618+ // dropdown-header should be a span.
613619 $ this ->assertRegExp (
614620 '/^(<span(.*?)>)(.*?)(<\/span>)$/ ' ,
615621 $ header_open . $ header_close ,
616622 'The opener and closer for ' . $ this ->valid_linkmod_typeflags [0 ] . ' does not seem to match expected elements. '
617623 );
618-
624+ // dropdown-divider should be a div.
619625 $ this ->assertRegExp (
620626 '/^(<div(.*?)>)(.*?)(<\/div>)$/ ' ,
621627 $ divider_open . $ divider_close ,
622- 'The opener and closer for ' . $ this ->valid_linkmod_typeflags [1 ] . ' linkmods does not seem to match expected elements. '
628+ 'The opener and closer for ' . $ this ->valid_linkmod_typeflags [1 ] . ' does not seem to match expected elements. '
629+ );
630+ // dropdown-item-text should be a span.
631+ $ this ->assertRegExp (
632+ '/^(<span(.*?)>)(.*?)(<\/span>)$/ ' ,
633+ $ text_open . $ text_close ,
634+ 'The opener and closer for ' . $ this ->valid_linkmod_typeflags [2 ] . ' does not seem to match expected elements. '
623635 );
624636 }
625637}
0 commit comments