Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #581: Windows diffs where polluted with extra newlines
- Loading branch information
Showing
4 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--TEST-- | ||
GH-581: PHPUnit_Util_Type::export adds extra newlines in Windows | ||
--FILE-- | ||
<?php | ||
|
||
$_SERVER['argv'][1] = '--no-configuration'; | ||
$_SERVER['argv'][2] = 'Issue581Test'; | ||
$_SERVER['argv'][3] = dirname(__FILE__).'/581/Issue581Test.php'; | ||
|
||
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/PHPUnit/Autoload.php'; | ||
PHPUnit_TextUI_Command::main(); | ||
?> | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann. | ||
|
||
F | ||
|
||
Time: %i %s, Memory: %sMb | ||
|
||
There was 1 failure: | ||
|
||
1) Issue581Test::testExportingObjectsDoesNotBreakWindowsLineFeeds | ||
Failed asserting that two objects are equal. | ||
--- Expected | ||
+++ Actual | ||
@@ @@ | ||
stdClass Object ( | ||
0 => 1 | ||
1 => 2 | ||
2 => 'Test\n' | ||
3 => 4 | ||
- 4 => 5 | ||
+ 4 => 1 | ||
5 => 6 | ||
6 => 7 | ||
7 => 8 | ||
) | ||
|
||
%s:%i | ||
|
||
FAILURES! | ||
Tests: 1, Assertions: 1, Failures: 1. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
class Issue581Test extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testExportingObjectsDoesNotBreakWindowsLineFeeds() { | ||
$this->assertEquals( | ||
(object)array(1,2,"Test\r\n",4,5,6,7,8), | ||
(object)array(1,2,"Test\r\n",4,1,6,7,8) | ||
); | ||
} | ||
} |