Skip to content

Commit

Permalink
Convert comment to docblock
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Jul 31, 2024
1 parent ce6a6a6 commit 2276f02
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions phpunit/class-wp-theme-json-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ public static function set_up_before_class() {
static::$user_id = self::factory()->user->create();
}

// Pretty print CSS in test assertions so that it provides a better diff when a test fails.
// Without this: the failing test outputs the entire css string as being different.
// With this: the failing test only highlights the specific CSS rule that is different.
/**
* Pretty print CSS in test assertions so that it provides a better diff when a test fails.
* Without this: the failing test outputs the entire css string as being different.
* With this: the failing test only highlights the specific CSS rule that is different.
*
* @param string $css A string of raw css with no line breaks.
* @return string The css with line breaks.
*/
private static function pretty_print_css( $css ) {
$css = str_replace( '{', " {\n", $css );
$css = str_replace( '}', "}\n\n", $css );
Expand Down

0 comments on commit 2276f02

Please sign in to comment.