Skip to content

Commit d5c2030

Browse files
Add stderr markers to updatedb test expected values
1 parent f37791a commit d5c2030

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tests/unish/Utils/OutputUtilsTrait.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,20 @@ protected function simplifyOutput($output)
4545
{
4646
// We do not care if Drush inserts a -t or not in the string. Depends on whether there is a tty.
4747
$output = preg_replace('# -t #', ' ', $output);
48+
// Remove multiple blank lines
49+
$output = preg_replace("#\n\n\n*#m", "\n\n", $output);
4850
// Remove double spaces from output to help protect test from false negatives if spacing changes subtly
4951
$output = preg_replace('# *#', ' ', $output);
5052
// Remove leading and trailing spaces.
51-
$output = preg_replace('#^ *#m', '', $output);
52-
$output = preg_replace('# *$#m', '', $output);
53-
// Remove multiple blank lines
54-
$output = preg_replace("#\n\n\n*#m", "\n\n", $output);
55-
// Remove stderr marker. @see realTimeOutput during siteProcess.
56-
$output = preg_replace('#ERR >#', '', $output);
53+
$output = preg_replace('#^[ \t]*#m', '', $output);
54+
$output = preg_replace('#[ \t]*$#m', '', $output);
5755
// Remove verbose info for rsync.
5856
$output = preg_replace('# -akzv --stats --progress #', ' -akz ', $output);
5957
// Debug flags may be added to command strings if we are in debug mode. Take those out so that tests in phpunit --debug mode work
6058
$output = preg_replace('# --debug #', ' ', $output);
6159
$output = preg_replace('# --verbose #', ' ', $output);
6260
// Get rid of any full paths in the output
63-
$output = str_replace(__DIR__, '__DIR__', $output);
61+
$output = preg_replace('#' . dirname(dirname(__DIR__)) . '/[^/]*#', '__DIR__', $output);
6462
$output = str_replace(self::getSandbox(), '__SANDBOX__', $output);
6563
$output = str_replace(self::getSut(), '__SUT__', $output);
6664

0 commit comments

Comments
 (0)