Skip to content

Commit c7a4c64

Browse files
committed
Improve formatting of empty array in export
1 parent a9a54ca commit c7a4c64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/phpunit/tests/template.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function set_up() {
131131
wp_styles();
132132

133133
$this->original_theme_features = $_wp_theme_features;
134-
$_wp_theme_features = array();
134+
$_wp_theme_features = array();
135135
foreach ( self::RESTORED_CONFIG_OPTIONS as $option ) {
136136
$this->original_ini_config[ $option ] = ini_get( $option );
137137
}
@@ -1795,6 +1795,7 @@ private static function get_array_snapshot_export( array $snapshot ): string {
17951795
$export = preg_replace( '/\barray \($/m', 'array(', $export );
17961796
$export = preg_replace( '/^(\s+)\d+\s+=>\s+/m', '$1', $export );
17971797
$export = preg_replace( '/=> *\n +/', '=> ', $export );
1798+
$export = preg_replace( '/array\(\n\s+\)/', 'array()', $export );
17981799
return preg_replace_callback(
17991800
'/(^ +)/m',
18001801
static function ( $matches ) {

0 commit comments

Comments
 (0)