minor #19988 [VarDumper] Fix extra whitespace (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[VarDumper] Fix extra whitespace

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| Tests pass?   | yes
| License       | MIT

Commits
-------

0d9dacc [VarDumper] Fix extra whitespace
This commit is contained in:
Nicolas Grekas 2016-09-20 15:15:54 +02:00
commit ca0fdf8977
2 changed files with 4 additions and 7 deletions

View File

@ -87,19 +87,17 @@ class DumpDataCollectorTest extends \PHPUnit_Framework_TestCase
$file = __FILE__;
if (PHP_VERSION_ID >= 50400) {
$xOutput = <<<EOTXT
<pre class=sf-dump id=sf-dump data-indent-pad=" "><a href="test://{$file}:{$line}" title="{$file}"><span class=sf-dump-meta>DumpDataCollectorTest.php</span></a> on line <span class=sf-dump-meta>{$line}</span>:
<pre class=sf-dump id=sf-dump data-indent-pad=" "><a href="test://{$file}:{$line}" title="{$file}"><span class=sf-dump-meta>DumpDataCollectorTest.php</span></a> on line <span class=sf-dump-meta>{$line}</span>:
<span class=sf-dump-num>123</span>
</pre>
EOTXT;
} else {
$len = strlen("DumpDataCollectorTest.php on line {$line}:");
$xOutput = <<<EOTXT
<pre class=sf-dump id=sf-dump data-indent-pad=" ">"<span class=sf-dump-str title="{$len} characters">DumpDataCollectorTest.php on line {$line}:</span>"
<pre class=sf-dump id=sf-dump data-indent-pad=" ">"<span class=sf-dump-str title="{$len} characters">DumpDataCollectorTest.php on line {$line}:</span>"
</pre>
<pre class=sf-dump id=sf-dump data-indent-pad=" "><span class=sf-dump-num>123</span>
</pre>
EOTXT;
}
@ -111,7 +109,7 @@ EOTXT;
$output = preg_replace('#<(script|style).*?</\1>#s', '', $output);
$output = preg_replace('/sf-dump-\d+/', 'sf-dump', $output);
$this->assertSame($xOutput, $output);
$this->assertSame($xOutput, trim($output));
$this->assertSame(1, $collector->getDumpsCount());
$collector->serialize();
}

View File

@ -288,8 +288,7 @@ return function (root) {
};
})(document);
</script>
<style>
</script><style>
pre.sf-dump {
display: block;
white-space: pre;