@@ -1637,7 +1637,7 @@ function test_db_check_normalize_slugs() {
16371637
16381638 $ title2 = 'post2-title ' ;
16391639 $ content2 = 'post2-content ' . $ decomposed_str1 ;
1640- $ post_name2 = "post2-name-%c3%bc " ;
1640+ $ post_name2 = "post2-name-%c3%bc " ; // Not decomposed.
16411641
16421642 $ post2 = $ this ->factory ->post ->create_and_get ( array ( 'post_title ' => $ title2 , 'post_content ' => $ content2 , 'post_type ' => 'post ' , 'post_name ' => $ post_name2 ) );
16431643 $ this ->assertTrue ( is_object ( $ post2 ) );
@@ -1744,6 +1744,7 @@ function test_db_check_normalize_slugs() {
17441744 $ die = self ::$ func_args ['wp_die ' ][0 ];
17451745 $ this ->assertSame ( count ( $ items ) - count ( $ _REQUEST ['item ' ] ), $ die ['args ' ]['num_slugs ' ] );
17461746 $ this ->assertNotContains ( $ title1 , unfc_list_pluck ( $ die ['args ' ]['slugs ' ], 'title ' ) ); // Can't use id as could be same between types.
1747+ $ this ->assertContains ( $ post_name1 , (array ) get_post_meta ( $ post1 ->ID , '_wp_old_slug ' ) );
17471748
17481749 ob_start ();
17491750 do_action ( $ hook_suffix );
@@ -1781,6 +1782,7 @@ function test_db_check_normalize_slugs() {
17811782 $ die = self ::$ func_args ['wp_die ' ][0 ];
17821783 $ this ->assertSame ( 2 , $ die ['args ' ]['num_slugs ' ] );
17831784 $ this ->assertSame ( $ unfc_normalize ->db_check_error_msg ( UNFC_DB_CHECK_SYNC_ERROR ), $ die ['args ' ][0 ][1 ] );
1785+ $ this ->assertContains ( $ post_name3 , (array ) get_post_meta ( $ post3 ->ID , '_wp_old_slug ' ) );
17841786
17851787 self ::clear_func_args ();
17861788
@@ -1798,6 +1800,7 @@ function test_db_check_normalize_slugs() {
17981800 $ this ->assertTrue ( false !== stripos ( $ die ['args ' ][0 ][1 ], 'nothing ' ) );
17991801 $ this ->assertSame ( 'warning ' , $ die ['args ' ][1 ][0 ] );
18001802 $ this ->assertTrue ( false !== stripos ( $ die ['args ' ][1 ][1 ], '1 ' ) );
1803+ $ this ->assertNotContains ( $ post_name2 , (array ) get_post_meta ( $ post2 ->ID , '_wp_old_slug ' ) ); // Slug was normalized (%c3%b2).
18011804
18021805 self ::clear_func_args ();
18031806
0 commit comments