diff --git a/composer.json b/composer.json
index cc5bb674..adba123e 100644
--- a/composer.json
+++ b/composer.json
@@ -39,7 +39,8 @@
},
"autoload": {
"psr-4": {
- "jblond\\": "lib/jblond"
+ "jblond\\": "lib/jblond",
+ "Tests\\": "tests"
}
},
"config": {
diff --git a/example/a.txt b/example/a.txt
index eab1ced5..9dddb84c 100644
--- a/example/a.txt
+++ b/example/a.txt
@@ -8,7 +8,7 @@
This line is removed from version2.
This line is also removed from version2.
This line is the same for both versions.
- This line has inline differences between both versions.
+ this line has inline differences between both versions.
This line is the same for both versions.
This line also has inline differences between both versions.
This line is the same for both versions.
diff --git a/example/example.php b/example/example.php
index caebc983..f88e30df 100644
--- a/example/example.php
+++ b/example/example.php
@@ -15,7 +15,7 @@
$sampleB = file_get_contents(dirname(__FILE__) . '/b.txt');
// Options for generating the diff.
-$customOptions = [
+$diffOptions = [
'context' => 2,
'trimEqual' => false,
'ignoreWhitespace' => true,
@@ -24,8 +24,14 @@
// Choose one of the initializations.
$diff = new Diff($sampleA, $sampleB); // Initialize the diff class with default options.
-//$diff = new Diff($sampleA, $sampleB, $customOptions); // Initialize the diff class with custom options.
-?>
+//$diff = new Diff($sampleA, $sampleB, $diffOptions); // Initialize the diff class with custom options.
+
+// Options for rendering the diff.
+$rendererOptions = [
+ 'inlineMarking' => $_GET['inlineMarking'] ?? Diff\Renderer\MainRenderer::CHANGE_LEVEL_LINE,
+]
+?>
+
@@ -46,50 +52,58 @@ function changeCSS(cssFile, cssLinkIndex) {
- PHP LibDiff - Examples
-
-
+PHP LibDiff - Examples
+
+
+
+
- HTML Side by Side Diff
+HTML Side by Side Diff
- isIdentical() ? 'No differences found.' : $diff->Render($renderer);
- ?>
+isIdentical() ? 'No differences found.' : $diff->Render($renderer);
+?>
- HTML Inline Diff
- isIdentical() ? 'No differences found.' : $diff->Render($renderer);
- ?>
+HTML Inline Diff
+isIdentical() ? 'No differences found.' : $diff->Render($renderer);
+?>
- HTML Unified Diff
- isIdentical() ? 'No differences found.' : '' . $diff->Render($renderer) . '
';
- ?>
+HTML Unified Diff
+isIdentical() ? 'No differences found.' : '' . $diff->Render($renderer) . '
';
+?>
- Text Unified Diff
- isIdentical() ?
- 'No differences found.' : '' . htmlspecialchars($diff->render($renderer)) . '
';
- ?>
+Text Unified Diff
+isIdentical() ?
+ 'No differences found.' : '' . htmlspecialchars($diff->render($renderer)) . '
';
+?>
- Text Context Diff
- isIdentical() ?
- 'No differences found.' : '' . htmlspecialchars($diff->render($renderer)) . '
';
- ?>
+Text Context Diff
+isIdentical() ?
+ 'No differences found.' : '' . htmlspecialchars($diff->render($renderer)) . '
';
+?>
diff --git a/lib/jblond/Diff/Renderer/MainRenderer.php b/lib/jblond/Diff/Renderer/MainRenderer.php
index 0a00e637..b936b6d3 100644
--- a/lib/jblond/Diff/Renderer/MainRenderer.php
+++ b/lib/jblond/Diff/Renderer/MainRenderer.php
@@ -4,6 +4,8 @@
namespace jblond\Diff\Renderer;
+use jblond\Diff\SequenceMatcher;
+
/**
* Base renderer for rendering diffs for PHP DiffLib.
*
@@ -135,7 +137,7 @@ protected function renderSequences(): array
if (($tag == 'replace') && ($blockSizeOld == $blockSizeNew)) {
// Inline differences between old and new block.
- $this->markInlineChange($oldText, $newText, $startOld, $endOld, $startNew);
+ $this->markInlineChanges($oldText, $newText, $startOld, $endOld, $startNew);
}
$lastBlock = $this->appendChangesArray($blocks, $tag, $startOld, $startNew);
@@ -167,6 +169,118 @@ protected function renderSequences(): array
return $changes;
}
+ /**
+ * Surround inline changes with markers.
+ *
+ * @param array $oldText Collection of lines of old text.
+ * @param array $newText Collection of lines of new text.
+ * @param int $startOld First line of the block in old to replace.
+ * @param int $endOld last line of the block in old to replace.
+ * @param int $startNew First line of the block in new to replace.
+ */
+ private function markInlineChanges(
+ array &$oldText,
+ array &$newText,
+ int $startOld,
+ int $endOld,
+ int $startNew
+ ): void {
+ if ($this->options['inlineMarking'] < self::CHANGE_LEVEL_LINE) {
+ $this->markInnerChange($oldText, $newText, $startOld, $endOld, $startNew);
+
+ return;
+ }
+
+ if ($this->options['inlineMarking'] == self::CHANGE_LEVEL_LINE) {
+ $this->markOuterChange($oldText, $newText, $startOld, $endOld, $startNew);
+ }
+ }
+
+ /**
+ * Add markers around inline changes between old and new text.
+ *
+ * Each line of the old and new text is evaluated.
+ * When a line of old differs from the same line of new, a marker is inserted into both lines, just before the first
+ * different character/word. A second marker is added just before the following character/word which matches again.
+ *
+ * Setting parameter changeType to self::CHANGE_LEVEL_CHAR will mark differences at character level.
+ * Other values will mark differences at word level.
+ *
+ * E.g. Character level.
+ *
+ * 1234567890
+ * Old => "aa bbc cdd" Start marker inserted at position 4
+ * New => "aa 12c cdd" End marker inserted at position 6
+ *
+ * E.g. Word level.
+ *
+ * 1234567890
+ * Old => "aa bbc cdd" Start marker inserted at position 4
+ * New => "aa 12c cdd" End marker inserted at position 7
+ *
+ *
+ * @param array $oldText Collection of lines of old text.
+ * @param array $newText Collection of lines of new text.
+ * @param int $startOld First line of the block in old to replace.
+ * @param int $endOld last line of the block in old to replace.
+ * @param int $startNew First line of the block in new to replace.
+ */
+ private function markInnerChange(array &$oldText, array &$newText, int $startOld, int $endOld, int $startNew): void
+ {
+ for ($iterator = 0; $iterator < ($endOld - $startOld); ++$iterator) {
+ // ChangeType 0: Character Level.
+ // ChangeType 1: Word Level.
+ $regex = $this->options['inlineMarking'] ? '/\w+|[^\w\s]|\s/u' : '/.?/u';
+
+ // Deconstruct the lines into arrays, including new empty element to the end in case a marker needs to be
+ // placed as last.
+ $oldLine = $this->sequenceToArray($regex, $oldText[$startOld + $iterator]);
+ $newLine = $this->sequenceToArray($regex, $newText[$startNew + $iterator]);
+ $oldLine[] = '';
+ $newLine[] = '';
+
+ $sequenceMatcher = new SequenceMatcher($oldLine, $newLine);
+ $opCodes = $sequenceMatcher->getGroupedOpCodes();
+
+ foreach ($opCodes as $group) {
+ foreach ($group as [$tag, $changeStartOld, $changeEndOld, $changeStartNew, $changeEndNew]) {
+ if ($tag == 'equal') {
+ continue;
+ }
+ if ($tag == 'replace' || $tag == 'delete') {
+ $oldLine[$changeStartOld] = "\0" . $oldLine[$changeStartOld];
+ $oldLine[$changeEndOld] = "\1" . $oldLine[$changeEndOld];
+ }
+ if ($tag == 'replace' || $tag == 'insert') {
+ $newLine[$changeStartNew] = "\0" . $newLine[$changeStartNew];
+ $newLine[$changeEndNew] = "\1" . $newLine[$changeEndNew];
+ }
+ }
+ }
+
+ // Reconstruct the lines and overwrite originals.
+ $oldText[$startOld + $iterator] = implode('', $oldLine);
+ $newText[$startNew + $iterator] = implode('', $newLine);
+ }
+ }
+
+ /**
+ * Split a sequence of characters into an array.
+ *
+ * Each element of the returned array contains a full pattern match of the regex pattern.
+ *
+ * @param string $pattern Regex pattern to split by.
+ * @param string $sequence The sequence to split.
+ *
+ * @return array The split sequence.
+ */
+ public function sequenceToArray(string $pattern, string $sequence): array
+ {
+ preg_match_all($pattern, $sequence, $matches);
+
+ return $matches[0];
+ }
+
/**
* Add markers around inline changes between old and new text.
*
@@ -187,7 +301,7 @@ protected function renderSequences(): array
* @param int $endOld last line of the block in old to replace.
* @param int $startNew First line of the block in new to replace.
*/
- private function markInlineChange(array &$oldText, array &$newText, int $startOld, int $endOld, int $startNew)
+ private function markOuterChange(array &$oldText, array &$newText, int $startOld, int $endOld, int $startNew): void
{
for ($iterator = 0; $iterator < ($endOld - $startOld); ++$iterator) {
// Check each line in the block for differences.
@@ -195,7 +309,7 @@ private function markInlineChange(array &$oldText, array &$newText, int $startOl
$newString = $newText[$startNew + $iterator];
// Determine the start and end position of the line difference.
- [$start, $end] = $this->getInlineChange($oldString, $newString);
+ [$start, $end] = $this->getOuterChange($oldString, $newString);
if ($start != 0 || $end != 0) {
// Changes between the lines exist.
// Add markers around the changed character sequence in the old string.
@@ -233,7 +347,7 @@ private function markInlineChange(array &$oldText, array &$newText, int $startOl
*
* @return array Array containing the starting position (0 by default) and the ending position (-1 by default)
*/
- private function getInlineChange(string $oldString, string $newString): array
+ private function getOuterChange(string $oldString, string $newString): array
{
$start = 0;
$limit = min(mb_strlen($oldString), mb_strlen($newString));
diff --git a/lib/jblond/Diff/Renderer/MainRendererAbstract.php b/lib/jblond/Diff/Renderer/MainRendererAbstract.php
index 5a11e3e5..febcc4b9 100644
--- a/lib/jblond/Diff/Renderer/MainRendererAbstract.php
+++ b/lib/jblond/Diff/Renderer/MainRendererAbstract.php
@@ -11,17 +11,32 @@
*
* PHP version 7.2 or greater
*
- * @package jblond\Diff\Renderer
- * @author Mario Brandt
- * @author Ferry Cools
+ * @package jblond\Diff\Renderer
+ * @author Mario Brandt
+ * @author Ferry Cools
* @copyright (c) 2009 Chris Boulton
- * @license New BSD License http://www.opensource.org/licenses/bsd-license.php
- * @version 2.2.1
- * @link https://github.com/JBlond/php-diff
+ * @license New BSD License http://www.opensource.org/licenses/bsd-license.php
+ * @version 2.2.1
+ * @link https://github.com/JBlond/php-diff
*/
abstract class MainRendererAbstract
{
-
+ /**
+ * Mark inline character differences.
+ */
+ public const CHANGE_LEVEL_CHAR = 0;
+ /**
+ * Mark inline word differences.
+ */
+ public const CHANGE_LEVEL_WORD = 1;
+ /**
+ * Mark line differences.
+ */
+ public const CHANGE_LEVEL_LINE = 2;
+ /**
+ * Mark no inline differences.
+ */
+ public const CHANGE_LEVEL_NONE = 4;
/**
* @var Diff $diff Instance of the diff class that this renderer is generating the rendered diff for.
*/
@@ -30,6 +45,11 @@ abstract class MainRendererAbstract
/**
* @var array Associative array containing the default options available for this renderer and their default
* value.
+ * - inlineMarking The level of how differences are marked.
+ * - self::CHANGE_LEVEL_NONE Don't Inline-Mark.
+ * - self::CHANGE_LEVEL_CHAR Inline-Mark each different character.
+ * - self::CHANGE_LEVEL_WORD Inline-Mark each different word.
+ * - self::CHANGE_LEVEL_LINE Inline-Mark from first to last line diff.
* - tabSize The amount of spaces to replace a tab character with.
* - format The format of the input texts.
* - cliColor Colorized output for cli.
@@ -40,6 +60,7 @@ abstract class MainRendererAbstract
* - deleteColors Fore- and background color for removed text. Only when cliColor = true.
*/
protected $mainOptions = [
+ 'inlineMarking' => self::CHANGE_LEVEL_LINE,
'tabSize' => 4,
'format' => 'plain',
'cliColor' => false,
@@ -60,7 +81,7 @@ abstract class MainRendererAbstract
* The constructor. Instantiates the rendering engine and if options are passed,
* sets the options for the renderer.
*
- * @param array $options Optionally, an array of the options for the renderer.
+ * @param array $options Optionally, an array of the options for the renderer.
*/
public function __construct(array $options = [])
{
@@ -72,9 +93,11 @@ public function __construct(array $options = [])
*
* Options are merged with the default to ensure that there aren't any missing options.
* When custom options are added to the default ones, they can be overwritten, but they can't be removed.
+ *
+ * @param array $options Array of options to set.
+ *
* @see MainRendererAbstract::$mainOptions
*
- * @param array $options Array of options to set.
*/
public function setOptions(array $options)
{
diff --git a/lib/jblond/Diff/Renderer/Text/InlineCli.php b/lib/jblond/Diff/Renderer/Text/InlineCli.php
index 1bcb9b6e..42684280 100644
--- a/lib/jblond/Diff/Renderer/Text/InlineCli.php
+++ b/lib/jblond/Diff/Renderer/Text/InlineCli.php
@@ -219,12 +219,14 @@ private function mergeChanges(
foreach ($baselineParts as $partKey => &$part) {
if ($iterator++ % 2) {
- // This part of the line has been changed. Surround it with user defied markers.
+ // This part of the line has been changed. Surround it with user defined markers.
$basePart = $this->options['deleteMarkers'][0] . $part . $this->options['deleteMarkers'][1];
- $changedPart =
- $this->options['insertMarkers'][0] .
- $changedLineParts[$partKey] .
- $this->options['insertMarkers'][1];
+ if (isset($changedLineParts[$partKey])) {
+ $changedPart =
+ $this->options['insertMarkers'][0] .
+ $changedLineParts[$partKey] .
+ $this->options['insertMarkers'][1];
+ }
if ($this->options['cliColor']) {
// Colorize the changed part.
diff --git a/tests/Diff/Renderer/MainRendererTest.php b/tests/Diff/Renderer/MainRendererTest.php
index 34742164..285e7f51 100644
--- a/tests/Diff/Renderer/MainRendererTest.php
+++ b/tests/Diff/Renderer/MainRendererTest.php
@@ -1,5 +1,7 @@
- * @author Ferry Cools
+ * @package Tests\Diff\Renderer
+ * @author Mario Brandt
+ * @author Ferry Cools
* @copyright (c) 2009 Mario Brandt
- * @license New BSD License http://www.opensource.org/licenses/bsd-license.php
- * @version 2.2.1
- * @link https://github.com/JBlond/php-diff
+ * @license New BSD License http://www.opensource.org/licenses/bsd-license.php
+ * @version 2.2.1
+ * @link https://github.com/JBlond/php-diff
*/
/**
* Class MainRendererTest
+ *
* @package Tests\Diff\Renderer\Html
*/
class MainRendererTest extends TestCase
@@ -40,9 +44,9 @@ class MainRendererTest extends TestCase
/**
* MainRendererTest constructor.
*
- * @param null $name
- * @param array $data
- * @param string $dataName
+ * @param null $name
+ * @param array $data
+ * @param string $dataName
*/
public function __construct($name = null, array $data = [], $dataName = '')
{
@@ -86,14 +90,14 @@ public function testRenderSimpleDelete()
/**
* Call protected/private method of a class.
*
- * @param object &$object Instantiated object that we will run method on.
- * @param string $methodName Method name to call
- * @param array $parameters Array of parameters to pass into method.
+ * @param object $object Instantiated object that we will run method on.
+ * @param string $methodName Method name to call
+ * @param array $parameters Array of parameters to pass into method.
*
* @return mixed Method return.
- * @throws \ReflectionException If the class doesn't exist.
+ * @throws ReflectionException If the class doesn't exist.
*/
- public function invokeMethod(&$object, $methodName, array $parameters = [])
+ public function invokeMethod(object $object, string $methodName, array $parameters = [])
{
$reflection = new ReflectionClass(get_class($object));
$method = $reflection->getMethod($methodName);
@@ -137,4 +141,52 @@ public function testRenderFixesSpaces()
$result
);
}
+
+ /**
+ * Test inline marking for changes at line level.
+ *
+ * Everything from the first difference to the last difference should be enclosed by the markers.
+ *
+ * @throws ReflectionException When invoking the method fails.
+ */
+ public function testMarkOuterChange()
+ {
+ $renderer = new MainRenderer();
+ $text1 = ['one two three four'];
+ $text2 = ['one tWo thrEe four'];
+ $this->invokeMethod($renderer, 'markOuterChange', [&$text1, &$text2, 0, 1, 0]);
+ $this->assertSame(["one t\0wo thre\1e four"], $text1);
+ $this->assertSame(["one t\0Wo thrE\1e four"], $text2);
+ }
+
+ /**
+ * Test inline marking for changes at character and word level.
+ *
+ * At character level, everything from a different character to any subsequent different character should be
+ * enclosed by the markers.
+ *
+ * At word level, every word that is different should be enclosed by the markers.
+ *
+ * @throws ReflectionException When invoking the method fails.
+ */
+ public function testMarkInnerChange()
+ {
+ $renderer = new MainRenderer();
+
+ // Character level.
+ $renderer->setOptions(['inlineMarking' => $renderer::CHANGE_LEVEL_CHAR]);
+ $text1 = ['one two three four'];
+ $text2 = ['one tWo thrEe fouR'];
+ $this->invokeMethod($renderer, 'markInnerChange', [&$text1, &$text2, 0, 1, 0]);
+ $this->assertSame(["one t\0w\1o thr\0e\1e fou\0r\1"], $text1);
+ $this->assertSame(["one t\0W\1o thr\0E\1e fou\0R\1"], $text2);
+
+ // Word Level.
+ $renderer->setOptions(['inlineMarking' => $renderer::CHANGE_LEVEL_WORD]);
+ $text1 = ['one two three four'];
+ $text2 = ['one tWo thrEe fouR'];
+ $this->invokeMethod($renderer, 'markInnerChange', [&$text1, &$text2, 0, 1, 0]);
+ $this->assertSame(["one \0two\1 \0three\1 \0four\1"], $text1);
+ $this->assertSame(["one \0tWo\1 \0thrEe\1 \0fouR\1"], $text2);
+ }
}
diff --git a/tests/resources/a.txt b/tests/resources/a.txt
index cdf834c1..066eedc0 100644
--- a/tests/resources/a.txt
+++ b/tests/resources/a.txt
@@ -7,7 +7,7 @@
This is demo content to show features of the php-diff package.
This line is removed from version2.
This line is the same for both versions.
- This line has inline differences between both versions.
+ this line has inline differences between both versions.
This line is the same for both versions.
This line also has inline differences between both versions.
This line is the same for both versions.
diff --git a/tests/resources/htmlInline.txt b/tests/resources/htmlInline.txt
index f28e973f..443cc066 100644
--- a/tests/resources/htmlInline.txt
+++ b/tests/resources/htmlInline.txt
@@ -56,13 +56,13 @@
10 |
|
- <h2>This line has inline differences between both versions.</h2>
+ <h2>this line has inline differences between both versions.</h2>
|
|
9 |
- <h2>This line has differences between both versions.</h2>
+ <h2>This line has differences between both versions.</h2>
|
11 |
diff --git a/tests/resources/htmlSideBySide.txt b/tests/resources/htmlSideBySide.txt
index fcbce226..67ce275c 100644
--- a/tests/resources/htmlSideBySide.txt
+++ b/tests/resources/htmlSideBySide.txt
@@ -86,11 +86,11 @@
10 |
- <h2>This line has inline differences between both versions.</h2>
+ <h2>this line has inline differences between both versions.</h2>
|
9 |
- <h2>This line has differences between both versions.</h2>
+ <h2>This line has differences between both versions.</h2>
|
11 |
diff --git a/tests/resources/htmlUnified.txt b/tests/resources/htmlUnified.txt
index 2da3bdd7..fc1adeeb 100644
--- a/tests/resources/htmlUnified.txt
+++ b/tests/resources/htmlUnified.txt
@@ -1 +1 @@
-<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>Hello World!</title>
<title>Hello You!</title>
</head>
<body>
<h1>This is demo content to show features of the php-diff package.</h1>
<h2>This line is removed from version2.</h2>
<h2>This line is the same for both versions.</h2>
<h2>This line has inline differences between both versions.</h2>
<h2>This line has differences between both versions.</h2>
<h2>This line is the same for both versions.</h2>
<h2>This line also has inline differences between both versions.</h2>
<h2>This line also has InLine differences between both versions.</h2>
<h2>This line is the same for both versions.</h2>
<h2>This line is added to version2.</h2>
<p>
It's also compatible with multibyte characters (like Chinese and emoji) as shown below:
另外我覺得那個評價的白色櫃子有點沒有必要欸。外觀我就不說了 ,怎麼連空間都那麼狹隘。不過倒是從這個地方看出所謂的“改革”
Do you know what "金槍魚罐頭" means in Chinese?
🍏🍎🙂
另外我覺得那個評鑑的白色櫃子有點沒有必要欸。外觀我就不說了 ,怎麼連空間都那麼狹隘。不過倒是從這個地方看出所謂的“改革”
Do you know what "魚の缶詰" means in Chinese?
🍎🍏🙂
</p>
<p>Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.</p>
…
<p>Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.</p>
<p>Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.</p>
<p>Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.</p>
<h2>This line also has inline differences between both versions. It's the whitespace in front.</h2>
<h2>This line also has inline differences between both versions. It's the whitespace in front.</h2>
<h2>This line is the same for both versions.</h2>
<h2>This line also has inline differences between both versions.</h2>
<h2>This line also has inline differences between both versions!</h2>
</body>
</html>
\ No newline at end of file
+<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>Hello World!</title>
<title>Hello You!</title>
</head>
<body>
<h1>This is demo content to show features of the php-diff package.</h1>
<h2>This line is removed from version2.</h2>
<h2>This line is the same for both versions.</h2>
<h2>this line has inline differences between both versions.</h2>
<h2>This line has differences between both versions.</h2>
<h2>This line is the same for both versions.</h2>
<h2>This line also has inline differences between both versions.</h2>
<h2>This line also has InLine differences between both versions.</h2>
<h2>This line is the same for both versions.</h2>
<h2>This line is added to version2.</h2>
<p>
It's also compatible with multibyte characters (like Chinese and emoji) as shown below:
另外我覺得那個評價的白色櫃子有點沒有必要欸。外觀我就不說了 ,怎麼連空間都那麼狹隘。不過倒是從這個地方看出所謂的“改革”
Do you know what "金槍魚罐頭" means in Chinese?
🍏🍎🙂
另外我覺得那個評鑑的白色櫃子有點沒有必要欸。外觀我就不說了 ,怎麼連空間都那麼狹隘。不過倒是從這個地方看出所謂的“改革”
Do you know what "魚の缶詰" means in Chinese?
🍎🍏🙂
</p>
<p>Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.</p>
…
<p>Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.</p>
<p>Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.</p>
<p>Just some lines to demonstrate the collapsing of a block of lines which are the same in both versions.</p>
<h2>This line also has inline differences between both versions. It's the whitespace in front.</h2>
<h2>This line also has inline differences between both versions. It's the whitespace in front.</h2>
<h2>This line is the same for both versions.</h2>
<h2>This line also has inline differences between both versions.</h2>
<h2>This line also has inline differences between both versions!</h2>
</body>
</html>
\ No newline at end of file
diff --git a/tests/resources/textContext.txt b/tests/resources/textContext.txt
index 034c6c13..8d234956 100644
--- a/tests/resources/textContext.txt
+++ b/tests/resources/textContext.txt
@@ -9,7 +9,7 @@
This is demo content to show features of the php-diff package.
- This line is removed from version2.
This line is the same for both versions.
-! This line has inline differences between both versions.
+! this line has inline differences between both versions.
This line is the same for both versions.
! This line also has inline differences between both versions.
This line is the same for both versions.
diff --git a/tests/resources/textInlineCli.txt b/tests/resources/textInlineCli.txt
index 3678f6f4..b3b08400 100644
--- a/tests/resources/textInlineCli.txt
+++ b/tests/resources/textInlineCli.txt
@@ -7,7 +7,7 @@ x| Hello [0;30m[41m-World-[0m[0;30m[42m+You+[0m!
=| This is demo content to show features of the php-diff package.
-|[0;30m[41m This line is removed from version2.
[0m
=| This line is the same for both versions.
-x| This line has [0;30m[41m-inline -[0m[0;30m[42m++[0mdifferences between both versions.
+x| [0;30m[41m-this line has inline-[0m[0;30m[42m+This line has+[0m differences between both versions.
=| This line is the same for both versions.
x| This line also has [0;30m[41m-inl-[0m[0;30m[42m+InL+[0mine differences between both versions.
=| This line is the same for both versions.
diff --git a/tests/resources/textUnified.txt b/tests/resources/textUnified.txt
index 1802b813..b5976f95 100644
--- a/tests/resources/textUnified.txt
+++ b/tests/resources/textUnified.txt
@@ -9,7 +9,7 @@
This is demo content to show features of the php-diff package.
- This line is removed from version2.
This line is the same for both versions.
-- This line has inline differences between both versions.
+- this line has inline differences between both versions.
+ This line has differences between both versions.
This line is the same for both versions.
- This line also has inline differences between both versions.
diff --git a/tests/resources/textUnifiedCli.txt b/tests/resources/textUnifiedCli.txt
index c66e4752..a8842c05 100644
--- a/tests/resources/textUnifiedCli.txt
+++ b/tests/resources/textUnifiedCli.txt
@@ -9,7 +9,7 @@
This is demo content to show features of the php-diff package.
- This line is removed from version2.
This line is the same for both versions.
-- This line has inline differences between both versions.
+- this line has inline differences between both versions.
+ This line has differences between both versions.
This line is the same for both versions.
- This line also has inline differences between both versions.