@@ -1637,7 +1637,7 @@ function test_db_check_normalize_slugs() {
1637
1637
1638
1638
$ title2 = 'post2-title ' ;
1639
1639
$ content2 = 'post2-content ' . $ decomposed_str1 ;
1640
- $ post_name2 = "post2-name-%c3%bc " ;
1640
+ $ post_name2 = "post2-name-%c3%bc " ; // Not decomposed.
1641
1641
1642
1642
$ post2 = $ this ->factory ->post ->create_and_get ( array ( 'post_title ' => $ title2 , 'post_content ' => $ content2 , 'post_type ' => 'post ' , 'post_name ' => $ post_name2 ) );
1643
1643
$ this ->assertTrue ( is_object ( $ post2 ) );
@@ -1744,6 +1744,7 @@ function test_db_check_normalize_slugs() {
1744
1744
$ die = self ::$ func_args ['wp_die ' ][0 ];
1745
1745
$ this ->assertSame ( count ( $ items ) - count ( $ _REQUEST ['item ' ] ), $ die ['args ' ]['num_slugs ' ] );
1746
1746
$ 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 ' ) );
1747
1748
1748
1749
ob_start ();
1749
1750
do_action ( $ hook_suffix );
@@ -1781,6 +1782,7 @@ function test_db_check_normalize_slugs() {
1781
1782
$ die = self ::$ func_args ['wp_die ' ][0 ];
1782
1783
$ this ->assertSame ( 2 , $ die ['args ' ]['num_slugs ' ] );
1783
1784
$ 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 ' ) );
1784
1786
1785
1787
self ::clear_func_args ();
1786
1788
@@ -1798,6 +1800,7 @@ function test_db_check_normalize_slugs() {
1798
1800
$ this ->assertTrue ( false !== stripos ( $ die ['args ' ][0 ][1 ], 'nothing ' ) );
1799
1801
$ this ->assertSame ( 'warning ' , $ die ['args ' ][1 ][0 ] );
1800
1802
$ 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).
1801
1804
1802
1805
self ::clear_func_args ();
1803
1806
0 commit comments