Skip to content

Commit ba5428c

Browse files
committed
Function test to test keepNewLines
In preperation of rewriting convertHtmlToListOfWords I added a test to check if the keepNewLines feature still works as expected afterwards.
1 parent af8750f commit ba5428c

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

tests/Caxy/Tests/HtmlDiff/Functional/HtmlDiffFunctionalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testHtmlDiff(string $oldText, string $newText, string $expected,
2929
$expected = $this->stripExtraWhitespaceAndNewLines($expected);
3030
}
3131

32-
static::assertEquals($expected, $output);
32+
static::assertEquals(trim($expected), trim($output));
3333
}
3434

3535
public function diffContentProvider()
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<options>
2+
<option type="boolean" name="setKeepNewLines" value="true" />
3+
<option type="boolean" name="setPurifierEnabled" value="false" />
4+
</options>
5+
6+
<oldText>
7+
Please read the non-informative information underneath <br />
8+
9+
<pre>
10+
This is the first paragraph.
11+
12+
13+
14+
This is the second paragraph
15+
</pre>
16+
</oldText>
17+
18+
<newText>
19+
Please read the non-informative information underneath <br />
20+
21+
<pre>
22+
This is the primary paragraph.
23+
24+
25+
26+
This is the secondary paragraph
27+
</pre>
28+
</newText>
29+
30+
<expected>
31+
Please read the non-informative information underneath <br />
32+
33+
<pre>
34+
This is the <del class="diffmod">first</del><ins class="diffmod">primary</ins> paragraph.
35+
36+
37+
38+
This is the <del class="diffmod">second</del><ins class="diffmod">secondary</ins> paragraph
39+
</pre>
40+
</expected>

0 commit comments

Comments
 (0)