File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
tests/phpunit/tests/functions Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -218,19 +218,15 @@ public function test_wp_get_archives_args_filter() {
218218
219219 $ ids = array_slice ( array_reverse ( self ::$ post_ids ), 0 , 3 );
220220
221- $ link1 = get_permalink ( $ ids [0 ] );
222- $ link2 = get_permalink ( $ ids [1 ] );
223- $ link3 = get_permalink ( $ ids [2 ] );
224-
225- $ title1 = get_post ( $ ids [0 ] )->post_title ;
226- $ title2 = get_post ( $ ids [1 ] )->post_title ;
227- $ title3 = get_post ( $ ids [2 ] )->post_title ;
228-
229- $ expected = <<<EOF
230- <li><a href=' $ link1'> $ title1</a></li>
231- <li><a href=' $ link2'> $ title2</a></li>
232- <li><a href=' $ link3'> $ title3</a></li>
233- EOF ;
221+ $ expected = join (
222+ "\n" ,
223+ array_map (
224+ static function ( $ id ) {
225+ return sprintf ( '<li><a href="%s">%s</a></li> ' , get_permalink ( $ id ), get_the_title ( $ id ) );
226+ },
227+ $ ids
228+ )
229+ );
234230 $ archives = wp_get_archives (
235231 array (
236232 'echo ' => false ,
You can’t perform that action at this time.
0 commit comments